Commit b74fc1ca authored by Dan Carpenter's avatar Dan Carpenter Committed by Saeed Mahameed
Browse files

net/mlx5: check for allocation failure in mlx5_ft_pool_init()



Add a check for if the kzalloc() fails.

Fixes: 4a98544d ("net/mlx5: Move chains ft pool to be used by all firmware steering")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent e6dfa4a5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ int mlx5_ft_pool_init(struct mlx5_core_dev *dev)
	int i;

	ft_pool = kzalloc(sizeof(*ft_pool), GFP_KERNEL);
	if (!ft_pool)
		return -ENOMEM;

	for (i = ARRAY_SIZE(FT_POOLS) - 1; i >= 0; i--)
		ft_pool->ft_left[i] = FT_SIZE / FT_POOLS[i];