Commit b508e0b6 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: 0e14c777 ("mlxsw: spectrum: Add the multicast routing hardware logic")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarYotam Gigi <yotamg@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 360cc342
...@@ -239,8 +239,8 @@ mlxsw_sp_mr_tcam_afa_block_create(struct mlxsw_sp *mlxsw_sp, ...@@ -239,8 +239,8 @@ mlxsw_sp_mr_tcam_afa_block_create(struct mlxsw_sp *mlxsw_sp,
int err; int err;
afa_block = mlxsw_afa_block_create(mlxsw_sp->afa); afa_block = mlxsw_afa_block_create(mlxsw_sp->afa);
if (IS_ERR(afa_block)) if (!afa_block)
return afa_block; return ERR_PTR(-ENOMEM);
err = mlxsw_afa_block_append_counter(afa_block, counter_index); err = mlxsw_afa_block_append_counter(afa_block, counter_index);
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment