OSDN Git Service

infiniband/qedr: Potential null ptr dereference of qp
authorAditya Pakki <pakki001@umn.edu>
Mon, 24 Dec 2018 18:24:45 +0000 (12:24 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:21:01 +0000 (09:21 +0100)
commit77a9b90d266b06abf3c90073b14fa83543b86234
tree2abe311a84f488866944d645598a44ae9ee1e73d
parent6a9d929bc9faa106f345d486d9a3a749cf4bb0ea
infiniband/qedr: Potential null ptr dereference of qp

[ Upstream commit 9c6260de505b63638dd86fcc33849b17f6146d94 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/qedr/qedr_iw_cm.c