[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171003105340.llwk5oajgrohbksu@mwanda>
Date: Tue, 3 Oct 2017 13:53:41 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Jiri Pirko <jiri@...lanox.com>, Yotam Gigi <yotamg@...lanox.com>
Cc: Ido Schimmel <idosch@...lanox.com>, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH 2/2 net-next] mlxsw: spectrum: Add missing error code on
allocation failure
We accidentally return success if the kmalloc_array() call fails.
Fixes: 0e14c7777acb ("mlxsw: spectrum: Add the multicast routing hardware logic")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
index 5e4ccbf17e3d..839eadf0765b 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
@@ -763,8 +763,10 @@ mlxsw_sp_mr_tcam_region_init(struct mlxsw_sp *mlxsw_sp,
parman_prios = kmalloc_array(MLXSW_SP_MR_ROUTE_PRIO_MAX + 1,
sizeof(*parman_prios), GFP_KERNEL);
- if (!parman_prios)
+ if (!parman_prios) {
+ err = -ENOMEM;
goto err_parman_prios_alloc;
+ }
mr_tcam_region->parman_prios = parman_prios;
for (i = 0; i < MLXSW_SP_MR_ROUTE_PRIO_MAX + 1; i++)
Powered by blists - more mailing lists