diff mbox series

[net-next] net/mlx5: Fix a NULL vs IS_ERR() check

Message ID YCO+NCjissLTG1H6@mwanda (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net/mlx5: Fix a NULL vs IS_ERR() check | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Dan Carpenter Feb. 10, 2021, 11:06 a.m. UTC
The mlx5_chains_get_table() function doesn't return NULL, it returns
error pointers so we need to fix this condition.

Fixes: 34ca65352ddf ("net/mlx5: E-Switch, Indirect table infrastructure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This applies to net-next but it might actually go through a different
tree before going to net?  I don't know how this works...

 drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vlad Buslov Feb. 10, 2021, 11:40 a.m. UTC | #1
On Wed 10 Feb 2021 at 13:06, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The mlx5_chains_get_table() function doesn't return NULL, it returns
> error pointers so we need to fix this condition.
>
> Fixes: 34ca65352ddf ("net/mlx5: E-Switch, Indirect table infrastructure")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, Dan!

Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
Saeed Mahameed Feb. 11, 2021, 4:17 a.m. UTC | #2
On Wed, 2021-02-10 at 13:40 +0200, Vlad Buslov wrote:
> On Wed 10 Feb 2021 at 13:06, Dan Carpenter <dan.carpenter@oracle.com>
> wrote:
> > The mlx5_chains_get_table() function doesn't return NULL, it
> > returns
> > error pointers so we need to fix this condition.
> > 
> > Fixes: 34ca65352ddf ("net/mlx5: E-Switch, Indirect table
> > infrastructure")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Thanks, Dan!
> 
> Reviewed-by: Vlad Buslov <vladbu@nvidia.com>

Applied to net-next-mlx5

Thanks!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
index b7d00c4c7046..6f6772bf61a2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
@@ -216,7 +216,7 @@  static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw,
 	flow_act.flags = FLOW_ACT_IGNORE_FLOW_LEVEL | FLOW_ACT_NO_APPEND;
 	dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
 	dest.ft = mlx5_chains_get_table(chains, 0, 1, 0);
-	if (!dest.ft) {
+	if (IS_ERR(dest.ft)) {
 		err = PTR_ERR(dest.ft);
 		goto err_table;
 	}