Commit 9b440078 authored by Bernard Metzler's avatar Bernard Metzler Committed by Doug Ledford

RDMA/siw: Fix potential NULL de-ref

In siw_connect() we have an error flow where there is no valid qp
pointer.  Make sure we don't try to de-ref in that situation.

Fixes: 6c52fdc2 ("rdma/siw: connection management")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBernard Metzler <bmt@zurich.ibm.com>
Link: https://lore.kernel.org/r/20190819140257.19319-1-bmt@zurich.ibm.comSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 27b7fb1a
......@@ -1515,7 +1515,7 @@ int siw_connect(struct iw_cm_id *id, struct iw_cm_conn_param *params)
}
}
error:
siw_dbg_qp(qp, "failed: %d\n", rv);
siw_dbg(id->device, "failed: %d\n", rv);
if (cep) {
siw_socket_disassoc(s);
......@@ -1540,7 +1540,8 @@ int siw_connect(struct iw_cm_id *id, struct iw_cm_conn_param *params)
} else if (s) {
sock_release(s);
}
siw_qp_put(qp);
if (qp)
siw_qp_put(qp);
return rv;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment