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: Aditya Pakki <pakki001@umn.edu> Acked-by: Michal Kalderon <michal.kalderon@marvell.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
94edd87a1c
commit
9c6260de50
|
@ -492,6 +492,8 @@ int qedr_iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
|
|||
int i;
|
||||
|
||||
qp = idr_find(&dev->qpidr.idr, conn_param->qpn);
|
||||
if (unlikely(!qp))
|
||||
return -EINVAL;
|
||||
|
||||
laddr = (struct sockaddr_in *)&cm_id->m_local_addr;
|
||||
raddr = (struct sockaddr_in *)&cm_id->m_remote_addr;
|
||||
|
|
Loading…
Reference in New Issue