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

Commit 55513fb4 authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller
Browse files

net: fail alloc_netdev_mq if queue count < 1



In alloc_netdev_mq fail if requested queue_count < 1.

Signed-off-by: default avatarTom Herbert <therbert@google.com>
Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5eeaa2db
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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 */