IB/mlx5: Fix NULL pointer dereference on debug print
authorEli Cohen <eli@mellanox.com>
Thu, 27 Oct 2016 13:36:46 +0000 (16:36 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:54:36 +0000 (03:54 +0000)
commitb959798f84b4252b6967d444e204dac67d732396
tree542b0ef5df7258c57fb1bc61545db56d770891b2
parent0d4ad2aae6062290538b0ff29cc09546103738df
IB/mlx5: Fix NULL pointer dereference on debug print

commit a1ab8402d15d2305d2315d96ec3294bfdf16587e upstream.

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

Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/infiniband/hw/mlx5/qp.c