提交 b5c7d4e5 编写于 作者: D Dan Carpenter 提交者: David S. Miller

mlxsw: spectrum: Add missing error code on allocation failure

We accidentally return success if the kmalloc_array() call fails.

Fixes: 0e14c777 ("mlxsw: spectrum: Add the multicast routing hardware logic")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NYotam Gigi <yotamg@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b508e0b6
......@@ -771,8 +771,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++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册