Commit fe33507e authored by Parav Pandit's avatar Parav Pandit Committed by Jason Gunthorpe

RDMA/core: Check error status of rdma_find_ndev_for_src_ip_rcu

rdma_find_ndev_for_src_ip_rcu() returns either valid netdev pointer or
ERR_PTR().  Instead of checking for NULL, check for error.

Fixes: caf1e3ae ("RDMA/core Introduce and use rdma_find_ndev_for_src_ip_rcu")
Reported-by: syzbot+20c32fa6ff84a2d28c36@syzkaller.appspotmail.com
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 15703461
...@@ -513,7 +513,7 @@ static int rdma_set_src_addr_rcu(struct rdma_dev_addr *dev_addr, ...@@ -513,7 +513,7 @@ static int rdma_set_src_addr_rcu(struct rdma_dev_addr *dev_addr,
* loopback IP address. * loopback IP address.
*/ */
ndev = rdma_find_ndev_for_src_ip_rcu(dev_net(ndev), dst_in); ndev = rdma_find_ndev_for_src_ip_rcu(dev_net(ndev), dst_in);
if (!ndev) if (IS_ERR(ndev))
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment