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: 0e14c7777a ("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>
This commit is contained in:
Dan Carpenter 2017-10-03 13:53:03 +03:00 committed by David S. Miller
parent 360cc342c9
commit b508e0b6e4
1 changed files with 2 additions and 2 deletions

View File

@ -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)