mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
RDMA/i40iw: fix a potential NULL pointer dereference
commit04db1580b5upstream. A NULL pointer can be returned by in_dev_get(). Thus add a corresponding check so that a NULL pointer dereference will be avoided at this place. Fixes:8e06af711b("i40iw: add main, hdr, status") Link: https://lore.kernel.org/r/1577672668-46499-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b1f90d263a
commit
33daaea78a
@@ -1225,6 +1225,8 @@ static void i40iw_add_ipv4_addr(struct i40iw_device *iwdev)
|
||||
const struct in_ifaddr *ifa;
|
||||
|
||||
idev = in_dev_get(dev);
|
||||
if (!idev)
|
||||
continue;
|
||||
in_dev_for_each_ifa_rtnl(ifa, idev) {
|
||||
i40iw_debug(&iwdev->sc_dev, I40IW_DEBUG_CM,
|
||||
"IP=%pI4, vlan_id=%d, MAC=%pM\n", &ifa->ifa_address,
|
||||
|
||||
Reference in New Issue
Block a user