mlxsw: spectrum: Add missing error code on allocation failure

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

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:41 +03:00 committed by David S. Miller
parent b508e0b6e4
commit b5c7d4e54c

View file

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