* [PATCH 1/3 v2] net: fail alloc_netdev_mq if queue count < 1
@ 2010-10-19 3:55 Tom Herbert
2010-10-19 5:02 ` Eric Dumazet
0 siblings, 1 reply; 2+ messages in thread
From: Tom Herbert @ 2010-10-19 3:55 UTC (permalink / raw)
To: davem, netdev; +Cc: bhutchings, eric.dumazet
In alloc_netdev_mq fail if requested queue_count < 1.
Signed-off-by: Tom Herbert <therbert@google.com>
---
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 04972a4..f44d29a 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,
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 */
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-19 5:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 3:55 [PATCH 1/3 v2] net: fail alloc_netdev_mq if queue count < 1 Tom Herbert
2010-10-19 5:02 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox