Commit 9c6260de authored by Aditya Pakki's avatar Aditya Pakki Committed by Jason Gunthorpe

infiniband/qedr: Potential null ptr dereference of qp

idr_find() may fail and return a NULL pointer. The fix checks the return
value of the function and returns an error in case of NULL.
Signed-off-by: default avatarAditya Pakki <pakki001@umn.edu>
Acked-by: default avatarMichal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 94edd87a
...@@ -492,6 +492,8 @@ int qedr_iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) ...@@ -492,6 +492,8 @@ int qedr_iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
int i; int i;
qp = idr_find(&dev->qpidr.idr, conn_param->qpn); qp = idr_find(&dev->qpidr.idr, conn_param->qpn);
if (unlikely(!qp))
return -EINVAL;
laddr = (struct sockaddr_in *)&cm_id->m_local_addr; laddr = (struct sockaddr_in *)&cm_id->m_local_addr;
raddr = (struct sockaddr_in *)&cm_id->m_remote_addr; raddr = (struct sockaddr_in *)&cm_id->m_remote_addr;
......
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