From: Israel Rukshin Date: Thu, 11 May 2017 15:52:36 +0000 (+0300) Subject: RDMA/srp: Fix NULL deref at srp_destroy_qp() X-Git-Tag: MMI-PSA29.97-13-9~4931^2~110 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=95c2ef50c726a51d580c35ae8dccd383abaa8701;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git RDMA/srp: Fix NULL deref at srp_destroy_qp() If srp_init_qp() fails at srp_create_ch_ib() then ch->send_cq may be NULL. Calling directly to ib_destroy_qp() is sufficient because no work requests were posted on the created qp. Fixes: 9294000d6d89 ("IB/srp: Drain the send queue before destroying a QP") Cc: Signed-off-by: Israel Rukshin Reviewed-by: Max Gurtovoy Reviewed-by: Bart van Assche -- Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index def723a5df29..4306285fb155 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -575,7 +575,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch) return 0; err_qp: - srp_destroy_qp(ch, qp); + ib_destroy_qp(qp); err_send_cq: ib_free_cq(send_cq);