Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1ab8402 authored by Eli Cohen's avatar Eli Cohen Committed by Doug Ledford
Browse files

IB/mlx5: Fix NULL pointer dereference on debug print



For XRC QP CQs may not exist. Check before attempting dereference.

Fixes: e126ba97 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
Signed-off-by: default avatarMaor Gottlieb <maorg@mellanox.com>
Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent dbaaff2a
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -2052,8 +2052,8 @@ struct ib_qp *mlx5_ib_create_qp(struct ib_pd *pd,


		mlx5_ib_dbg(dev, "ib qpnum 0x%x, mlx qpn 0x%x, rcqn 0x%x, scqn 0x%x\n",
		mlx5_ib_dbg(dev, "ib qpnum 0x%x, mlx qpn 0x%x, rcqn 0x%x, scqn 0x%x\n",
			    qp->ibqp.qp_num, qp->trans_qp.base.mqp.qpn,
			    qp->ibqp.qp_num, qp->trans_qp.base.mqp.qpn,
			    to_mcq(init_attr->recv_cq)->mcq.cqn,
			    init_attr->recv_cq ? to_mcq(init_attr->recv_cq)->mcq.cqn : -1,
			    to_mcq(init_attr->send_cq)->mcq.cqn);
			    init_attr->send_cq ? to_mcq(init_attr->send_cq)->mcq.cqn : -1);


		qp->trans_qp.xrcdn = xrcdn;
		qp->trans_qp.xrcdn = xrcdn;