提交 30e514a7 编写于 作者: J Jack Morgenstein 提交者: David S. Miller

net/mlx4_core: Fail device init if num_vfs is negative

Should not allow negative num_vfs
Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.com>
Signed-off-by: NVladimir Sokolovsky <vlad@mellanox.com>
Signed-off-by: NAmir Vadai <amirv@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 674925ed
......@@ -2077,6 +2077,11 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data)
num_vfs, MLX4_MAX_NUM_VF);
return -EINVAL;
}
if (num_vfs < 0) {
pr_err("num_vfs module parameter cannot be negative\n");
return -EINVAL;
}
/*
* Check for BARs.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册