Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30e514a7 authored by Jack Morgenstein's avatar Jack Morgenstein Committed by David S. Miller
Browse files

net/mlx4_core: Fail device init if num_vfs is negative



Should not allow negative num_vfs

Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.com>
Signed-off-by: default avatarVladimir Sokolovsky <vlad@mellanox.com>
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 674925ed
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -2077,6 +2077,11 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data)
		       num_vfs, MLX4_MAX_NUM_VF);
		       num_vfs, MLX4_MAX_NUM_VF);
		return -EINVAL;
		return -EINVAL;
	}
	}

	if (num_vfs < 0) {
		pr_err("num_vfs module parameter cannot be negative\n");
		return -EINVAL;
	}
	/*
	/*
	 * Check for BARs.
	 * Check for BARs.
	 */
	 */