mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
RDMA/irdma: Fix potential NULL-ptr-dereference
in_dev_get() can return NULL which will cause a failure once idev is
dereferenced in in_dev_for_each_ifa_rtnl(). This patch adds a
check for NULL value in idev beforehand.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 146b9756f1
("RDMA/irdma: Add connection manager")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Link: https://lore.kernel.org/r/20230126185230.62464-1-n.zhandarovich@fintech.ru
Reviewed-by: Sindhu Devale <sindhu.devale@intel.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
e632291a2d
commit
5d9745cead
1 changed files with 3 additions and 0 deletions
|
@ -1722,6 +1722,9 @@ static int irdma_add_mqh_4(struct irdma_device *iwdev,
|
|||
continue;
|
||||
|
||||
idev = in_dev_get(ip_dev);
|
||||
if (!idev)
|
||||
continue;
|
||||
|
||||
in_dev_for_each_ifa_rtnl(ifa, idev) {
|
||||
ibdev_dbg(&iwdev->ibdev,
|
||||
"CM: Allocating child CM Listener forIP=%pI4, vlan_id=%d, MAC=%pM\n",
|
||||
|
|
Loading…
Reference in a new issue