diff mbox series

net/mlx5e: Fix an IS_ERR() vs NULL check

Message ID 20200304142151.qivcobp6ngrynb2p@kili.mountain (mailing list archive)
State Not Applicable
Headers show
Series net/mlx5e: Fix an IS_ERR() vs NULL check | expand

Commit Message

Dan Carpenter March 4, 2020, 2:22 p.m. UTC
The esw_vport_tbl_get() function returns error pointers on error.

Fixes: 96e326878fa5 ("net/mlx5e: Eswitch, Use per vport tables for mirroring")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Saeed Mahameed March 4, 2020, 8:31 p.m. UTC | #1
On Wed, 2020-03-04 at 17:22 +0300, Dan Carpenter wrote:
> The esw_vport_tbl_get() function returns error pointers on error.
> 
> Fixes: 96e326878fa5 ("net/mlx5e: Eswitch, Use per vport tables for
> mirroring")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Hi Dan the patch looks fine, but you didn't cc netdev mailing list
Two options:

1) I can pick this patch up and repost it myself in a future pull
request
2) you can re-post it and cc netdev also mark it for net [PATCH net]

let me know what you prefer.

Thanks,
Saeed.


> ---
>  drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> index 4b5b6618dff4..692fe9e6a08f 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> @@ -198,7 +198,7 @@ int mlx5_esw_vport_tbl_get(struct mlx5_eswitch
> *esw)
>  	mlx5_esw_for_all_vports(esw, i, vport) {
>  		attr.in_rep->vport = vport->vport;
>  		fdb = esw_vport_tbl_get(esw, &attr);
> -		if (!fdb)
> +		if (IS_ERR(fdb))
>  			goto out;
>  	}
>  	return 0;
Dan Carpenter March 5, 2020, 8 a.m. UTC | #2
On Wed, Mar 04, 2020 at 08:31:13PM +0000, Saeed Mahameed wrote:
> On Wed, 2020-03-04 at 17:22 +0300, Dan Carpenter wrote:
> > The esw_vport_tbl_get() function returns error pointers on error.
> > 
> > Fixes: 96e326878fa5 ("net/mlx5e: Eswitch, Use per vport tables for
> > mirroring")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Hi Dan the patch looks fine, but you didn't cc netdev mailing list
> Two options:
> 
> 1) I can pick this patch up and repost it myself in a future pull
> request

I assumed we would do this, because the original patch didn't have
Dave's signed-off-by.

> 2) you can re-post it and cc netdev also mark it for net [PATCH net]

If we were going to go that route then it would have to [PATCH net-next]
because it doesn't apply to the net tree.

regards,
dan carpenter
Saeed Mahameed March 5, 2020, 11:11 p.m. UTC | #3
On Thu, 2020-03-05 at 11:00 +0300, Dan Carpenter wrote:
> On Wed, Mar 04, 2020 at 08:31:13PM +0000, Saeed Mahameed wrote:
> > On Wed, 2020-03-04 at 17:22 +0300, Dan Carpenter wrote:
> > > The esw_vport_tbl_get() function returns error pointers on error.
> > > 
> > > Fixes: 96e326878fa5 ("net/mlx5e: Eswitch, Use per vport tables
> > > for
> > > mirroring")
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > Hi Dan the patch looks fine, but you didn't cc netdev mailing list
> > Two options:
> > 
> > 1) I can pick this patch up and repost it myself in a future pull
> > request
> 
> I assumed we would do this, because the original patch didn't have
> Dave's signed-off-by.
> 

We maintain the net-next-mlx5 branch under netdev mailing list.

> > 2) you can re-post it and cc netdev also mark it for net [PATCH
> > net]
> 
> If we were going to go that route then it would have to [PATCH net-
> next]
> because it doesn't apply to the net tree.
> 

I see, i will take it myself to net-next-mlx5 and will submit to net-
next soon in my next pull request to dave.

Thanks,
Saeed.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 4b5b6618dff4..692fe9e6a08f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -198,7 +198,7 @@  int mlx5_esw_vport_tbl_get(struct mlx5_eswitch *esw)
 	mlx5_esw_for_all_vports(esw, i, vport) {
 		attr.in_rep->vport = vport->vport;
 		fdb = esw_vport_tbl_get(esw, &attr);
-		if (!fdb)
+		if (IS_ERR(fdb))
 			goto out;
 	}
 	return 0;