mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue