diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-10-03 13:53:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-03 10:26:58 -0700 |
commit | b508e0b6e47c85a095ef056f3de6ba9d396c490c (patch) | |
tree | 6086b8e7e17275e98c9c9be323147c8b837bb2da | |
parent | 360cc342c9037ed487adf07212000f69c0ffa14d (diff) | |
download | linux-b508e0b6e47c85a095ef056f3de6ba9d396c490c.tar.bz2 |
mlxsw: spectrum: Fix check for IS_ERR() instead of NULL
mlxsw_afa_block_create() doesn't return error pointers, it returns NULL
on error.
Fixes: 0e14c7777acb ("mlxsw: spectrum: Add the multicast routing hardware logic")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c index 3ffb28dd4057..3a61896ae4d8 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c @@ -239,8 +239,8 @@ mlxsw_sp_mr_tcam_afa_block_create(struct mlxsw_sp *mlxsw_sp, int err; afa_block = mlxsw_afa_block_create(mlxsw_sp->afa); - if (IS_ERR(afa_block)) - return afa_block; + if (!afa_block) + return ERR_PTR(-ENOMEM); err = mlxsw_afa_block_append_counter(afa_block, counter_index); if (err) |