]> www.infradead.org Git - users/jedix/linux-maple.git/commit
RDMA/irdma: Fix potential NULL-ptr-dereference
authorNikita Zhandarovich <n.zhandarovich@fintech.ru>
Thu, 26 Jan 2023 18:52:30 +0000 (10:52 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2023 18:11:43 +0000 (19:11 +0100)
commit360682fe7df262d94fae54f737c487bec0f9190d
tree96ce8139118c35d188a4069b2ad4a73779e7e693
parentf6d8b6762bee15551e538eef021b93477634d38f
RDMA/irdma: Fix potential NULL-ptr-dereference

[ Upstream commit 5d9745cead1f121974322b94ceadfb4d1e67960e ]

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: 146b9756f14c ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/irdma/cm.c