mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 00:40:03 +00:00
net: fail alloc_netdev_mq if queue count < 1
In alloc_netdev_mq fail if requested queue_count < 1. Signed-off-by: Tom Herbert <therbert@google.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5eeaa2db16
commit
55513fb428
1 changed files with 6 additions and 0 deletions
|
@ -5511,6 +5511,12 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
|
|||
|
||||
BUG_ON(strlen(name) >= sizeof(dev->name));
|
||||
|
||||
if (queue_count < 1) {
|
||||
pr_err("alloc_netdev: Unable to allocate device "
|
||||
"with zero queues.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
alloc_size = sizeof(struct net_device);
|
||||
if (sizeof_priv) {
|
||||
/* ensure 32-byte alignment of private area */
|
||||
|
|
Loading…
Reference in a new issue