projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5eeaa2d
)
net: fail alloc_netdev_mq if queue count < 1
author
Tom Herbert
<
[email protected]
>
Mon, 18 Oct 2010 17:55:58 +0000
(17:55 +0000)
committer
David S. Miller
<
[email protected]
>
Wed, 20 Oct 2010 09:27:58 +0000
(
02:27
-0700)
In alloc_netdev_mq fail if requested queue_count < 1.
Signed-off-by: Tom Herbert <
[email protected]
>
Acked-by: Eric Dumazet <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/core/dev.c
patch
|
blob
|
history
diff --git
a/net/core/dev.c
b/net/core/dev.c
index 04972a4783e2e9b75c54fd5c8e30bfedcf674ecc..f44d29ae5d6735f00e3346b987e330b18f65f86a 100644
(file)
--- 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 */