All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
@ 2020-04-22  9:22 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2020-04-22  9:22 UTC (permalink / raw)
  To: Faisal Latif
  Cc: Shiraz Saleem, Doug Ledford, Jason Gunthorpe, Shannon Nelson,
	Anjali Singhai Jain, linux-rdma, kernel-janitors

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/i40iw/i40iw_hw.c b/drivers/infiniband/hw/i40iw/i40iw_hw.c
index 55a1fbf0e670..ae8b97c30665 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_hw.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c
@@ -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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
@ 2020-04-22  9:22 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2020-04-22  9:22 UTC (permalink / raw)
  To: Faisal Latif
  Cc: Shiraz Saleem, Doug Ledford, Jason Gunthorpe, Shannon Nelson,
	Anjali Singhai Jain, linux-rdma, kernel-janitors

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/i40iw/i40iw_hw.c b/drivers/infiniband/hw/i40iw/i40iw_hw.c
index 55a1fbf0e670..ae8b97c30665 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_hw.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c
@@ -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)
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
  2020-04-22  9:22 ` Dan Carpenter
@ 2020-04-25 23:00   ` Jason Gunthorpe
  -1 siblings, 0 replies; 8+ messages in thread
From: Jason Gunthorpe @ 2020-04-25 23:00 UTC (permalink / raw)
  To: Dan Carpenter, Shiraz Saleem
  Cc: Faisal Latif, Doug Ledford, Shannon Nelson, Anjali Singhai Jain,
	linux-rdma, kernel-janitors

On Wed, Apr 22, 2020 at 12:22:11PM +0300, Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>  drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_hw.c b/drivers/infiniband/hw/i40iw/i40iw_hw.c
> index 55a1fbf0e670..ae8b97c30665 100644
> +++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c
> @@ -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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
@ 2020-04-25 23:00   ` Jason Gunthorpe
  0 siblings, 0 replies; 8+ messages in thread
From: Jason Gunthorpe @ 2020-04-25 23:00 UTC (permalink / raw)
  To: Dan Carpenter, Shiraz Saleem
  Cc: Faisal Latif, Doug Ledford, Shannon Nelson, Anjali Singhai Jain,
	linux-rdma, kernel-janitors

On Wed, Apr 22, 2020 at 12:22:11PM +0300, Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>  drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_hw.c b/drivers/infiniband/hw/i40iw/i40iw_hw.c
> index 55a1fbf0e670..ae8b97c30665 100644
> +++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c
> @@ -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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
  2020-04-25 23:00   ` Jason Gunthorpe
@ 2020-04-27 17:54     ` Saleem, Shiraz
  -1 siblings, 0 replies; 8+ messages in thread
From: Saleem, Shiraz @ 2020-04-27 17:54 UTC (permalink / raw)
  To: Jason Gunthorpe, Dan Carpenter
  Cc: Latif, Faisal, Doug Ledford, Shannon Nelson, Singhai, Anjali,
	linux-rdma, kernel-janitors

> Subject: Re: [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
> 
> On Wed, Apr 22, 2020 at 12:22:11PM +0300, Dan Carpenter wrote:
> > 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")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/hw/i40iw/i40iw_hw.c
> > b/drivers/infiniband/hw/i40iw/i40iw_hw.c
> > index 55a1fbf0e670..ae8b97c30665 100644
> > +++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c
> > @@ -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?
> 
Yes. Not convinced i40iw_manage_arp_cache being a void is ok
but that's a separate problem which I ll review internally.

Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
@ 2020-04-27 17:54     ` Saleem, Shiraz
  0 siblings, 0 replies; 8+ messages in thread
From: Saleem, Shiraz @ 2020-04-27 17:54 UTC (permalink / raw)
  To: Jason Gunthorpe, Dan Carpenter
  Cc: Latif, Faisal, Doug Ledford, Shannon Nelson, Singhai, Anjali,
	linux-rdma, kernel-janitors

> Subject: Re: [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
> 
> On Wed, Apr 22, 2020 at 12:22:11PM +0300, Dan Carpenter wrote:
> > 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")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/hw/i40iw/i40iw_hw.c
> > b/drivers/infiniband/hw/i40iw/i40iw_hw.c
> > index 55a1fbf0e670..ae8b97c30665 100644
> > +++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c
> > @@ -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?
> 
Yes. Not convinced i40iw_manage_arp_cache being a void is ok
but that's a separate problem which I ll review internally.

Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
  2020-04-22  9:22 ` Dan Carpenter
@ 2020-05-04 17:13   ` Jason Gunthorpe
  -1 siblings, 0 replies; 8+ messages in thread
From: Jason Gunthorpe @ 2020-05-04 17:13 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Faisal Latif, Shiraz Saleem, Doug Ledford, Shannon Nelson,
	Anjali Singhai Jain, linux-rdma, kernel-janitors

On Wed, Apr 22, 2020 at 12:22:11PM +0300, Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
>  drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc, thanks

Jason

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache()
@ 2020-05-04 17:13   ` Jason Gunthorpe
  0 siblings, 0 replies; 8+ messages in thread
From: Jason Gunthorpe @ 2020-05-04 17:13 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Faisal Latif, Shiraz Saleem, Doug Ledford, Shannon Nelson,
	Anjali Singhai Jain, linux-rdma, kernel-janitors

On Wed, Apr 22, 2020 at 12:22:11PM +0300, Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
>  drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc, thanks

Jason

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-04 17:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22  9:22 [PATCH] i40iw: Fix error handling in i40iw_manage_arp_cache() Dan Carpenter
2020-04-22  9:22 ` Dan Carpenter
2020-04-25 23:00 ` Jason Gunthorpe
2020-04-25 23:00   ` Jason Gunthorpe
2020-04-27 17:54   ` Saleem, Shiraz
2020-04-27 17:54     ` Saleem, Shiraz
2020-05-04 17:13 ` Jason Gunthorpe
2020-05-04 17:13   ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.