diff options
-rw-r--r-- | net/core/dev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 04972a4783e2..f44d29ae5d67 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5511,6 +5511,12 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, | |||
5511 | 5511 | ||
5512 | BUG_ON(strlen(name) >= sizeof(dev->name)); | 5512 | BUG_ON(strlen(name) >= sizeof(dev->name)); |
5513 | 5513 | ||
5514 | if (queue_count < 1) { | ||
5515 | pr_err("alloc_netdev: Unable to allocate device " | ||
5516 | "with zero queues.\n"); | ||
5517 | return NULL; | ||
5518 | } | ||
5519 | |||
5514 | alloc_size = sizeof(struct net_device); | 5520 | alloc_size = sizeof(struct net_device); |
5515 | if (sizeof_priv) { | 5521 | if (sizeof_priv) { |
5516 | /* ensure 32-byte alignment of private area */ | 5522 | /* ensure 32-byte alignment of private area */ |