Commit c7ebe23c authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

net/mlx5: Lag, fix a potential Oops with mlx5_lag_create_definer()



There is a minus character missing from ERR_PTR(ENOMEM) so if this
allocation fails it will lead to an Oops in the caller.

Fixes: dc48516e ("net/mlx5: Lag, add support to create definers for LAG")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 721111b1
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -289,7 +289,7 @@ mlx5_lag_create_definer(struct mlx5_lag *ldev, enum netdev_lag_hash hash,


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


	match_definer_mask = kvzalloc(MLX5_FLD_SZ_BYTES(match_definer,
	match_definer_mask = kvzalloc(MLX5_FLD_SZ_BYTES(match_definer,
							match_mask),
							match_mask),