netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2 net-next] mlxsw: spectrum: Fix check for IS_ERR() instead of NULL
@ 2017-10-03 10:53 Dan Carpenter
  2017-10-03 10:53 ` [PATCH 2/2 net-next] mlxsw: spectrum: Add missing error code on allocation failure Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dan Carpenter @ 2017-10-03 10:53 UTC (permalink / raw)
  To: Jiri Pirko, Yotam Gigi; +Cc: Ido Schimmel, netdev, kernel-janitors

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>

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
index cda9e9ad10e3..5e4ccbf17e3d 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)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-03 17:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-03 10:53 [PATCH 1/2 net-next] mlxsw: spectrum: Fix check for IS_ERR() instead of NULL Dan Carpenter
2017-10-03 10:53 ` [PATCH 2/2 net-next] mlxsw: spectrum: Add missing error code on allocation failure Dan Carpenter
2017-10-03 10:56   ` Yotam Gigi
2017-10-03 17:27   ` David Miller
2017-10-03 10:58 ` [PATCH 1/2 net-next] mlxsw: spectrum: Fix check for IS_ERR() instead of NULL Yotam Gigi
2017-10-03 17:27 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).