]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
i40iw: Fix error handling in i40iw_manage_arp_cache()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 22 Apr 2020 09:22:11 +0000 (12:22 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 4 May 2020 17:12:35 +0000 (14:12 -0300)
The i40iw_arp_table() function can return -EOVERFLOW if
i40iw_alloc_resource() fails so we can't just test for "== -1".

Fixes: 4e9042e647ff ("i40iw: add hw and utils files")
Link: https://lore.kernel.org/r/20200422092211.GA195357@mwanda
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/i40iw/i40iw_hw.c

index 55a1fbf0e670c7fa1a775d94e35dd77ee07e0cba..ae8b97c3066575388c6d3381b0d76f03b5eb8910 100644 (file)
@@ -534,7 +534,7 @@ void i40iw_manage_arp_cache(struct i40iw_device *iwdev,
        int arp_index;
 
        arp_index = i40iw_arp_table(iwdev, ip_addr, ipv4, mac_addr, action);
-       if (arp_index == -1)
+       if (arp_index < 0)
                return;
        cqp_request = i40iw_get_cqp_request(&iwdev->cqp, false);
        if (!cqp_request)