i40iw: Fix error handling in i40iw_manage_arp_cache()
Subsystems (2)
PATCH 1/1 i40iw: Fix error handling in i40iw_manage_arp_cache()
The i40iw_arp_table() function can return -EOVERFLOW if i40iw_alloc_resource() fails so we can't just test for "= -1".
--- drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/i40iw/i40iw_hw.c +1 -1
@@ -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)
Signature · 1 line
2.25.1
Quoted 12 lines · Dan Carpenter
The
i40iw_arp_table()function can return-EOVERFLOWifi40iw_alloc_resource()fails so we can't just test for "= -1".Fixes 4e9042e647ff ("i40iw: add hw and utils files")Signed-off-by Dan Carpenter <[email protected]>drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/hw/i40iw/i40iw_hw.c +1
-0+++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c
drivers/infiniband/hw/i40iw/i40iw_hw.c void i40iw_manage_arp_cache(struct i40iw_device *iwdev, · line 540
Quoted 8 lines
drivers/infiniband/hw/i40iw/i40iw_hw.c +1
-1@@ -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)
It is right Shiraz?
Jason
Saleem, Shiraz
Acked-byQuoted 19 lines
Subject: Re: [PATCH] i40iw: Fix error handling in
i40iw_manage_arp_cache()drivers/infiniband/hw/i40iw/i40iw_hw.c void i40iw_manage_arp_cache(struct i40iw_device
Quoted 13 lines · Dan Carpenter
The
i40iw_arp_table()function can return-EOVERFLOWifi40iw_alloc_resource()fails so we can't just test for "= -1".Fixes 4e9042e647ff ("i40iw: add hw and utils files")Signed-off-by Dan Carpenter <[email protected]>
drivers/infiniband/hw/i40iw/i40iw_hw.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/hw/i40iw/i40iw_hw.c +1
-0+++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c@@ -534,7 +534,7 @@ void i40iw_manage_arp_cache(struct i40iw_device*iwdev,
Quoted 2 lines
drivers/infiniband/hw/i40iw/i40iw_hw.c +0
-0int arp_index;
Quoted 9 lines
drivers/infiniband/hw/i40iw/i40iw_hw.c void i40iw_manage_arp_cache(struct i40iw_device *iwdev, · line 540
Quoted 6 lines
drivers/infiniband/hw/i40iw/i40iw_hw.c +1
-1arp_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)It is right Shiraz?
Yes. Not convinced i40iw_manage_arp_cache being a void is ok but that's a separate problem which I ll review internally.
Jason Gunthorpe
AppliedQuoted 9 lines · Dan Carpenter
The
i40iw_arp_table()function can return-EOVERFLOWifi40iw_alloc_resource()fails so we can't just test for "= -1".Fixes 4e9042e647ff ("i40iw: add hw and utils files")Signed-off-by Dan Carpenter <[email protected]>Acked-by Shiraz Saleem <[email protected]>--- drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-rc, thanks
Jason