diff options
-rw-r--r-- | include/linux/netdevice.h | 2 | ||||
-rw-r--r-- | net/core/dev.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9820ca1e45e2..4a616d73cc25 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -575,7 +575,7 @@ struct net_device | |||
575 | 575 | ||
576 | /* The TX queue control structures */ | 576 | /* The TX queue control structures */ |
577 | unsigned int egress_subqueue_count; | 577 | unsigned int egress_subqueue_count; |
578 | struct net_device_subqueue egress_subqueue[0]; | 578 | struct net_device_subqueue egress_subqueue[1]; |
579 | }; | 579 | }; |
580 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 580 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
581 | 581 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index 38212c3f9971..ee4035571c21 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -3624,7 +3624,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, | |||
3624 | 3624 | ||
3625 | /* ensure 32-byte alignment of both the device and private area */ | 3625 | /* ensure 32-byte alignment of both the device and private area */ |
3626 | alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST + | 3626 | alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST + |
3627 | (sizeof(struct net_device_subqueue) * queue_count)) & | 3627 | (sizeof(struct net_device_subqueue) * (queue_count - 1))) & |
3628 | ~NETDEV_ALIGN_CONST; | 3628 | ~NETDEV_ALIGN_CONST; |
3629 | alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; | 3629 | alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; |
3630 | 3630 | ||
@@ -3642,7 +3642,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, | |||
3642 | dev->priv = ((char *)dev + | 3642 | dev->priv = ((char *)dev + |
3643 | ((sizeof(struct net_device) + | 3643 | ((sizeof(struct net_device) + |
3644 | (sizeof(struct net_device_subqueue) * | 3644 | (sizeof(struct net_device_subqueue) * |
3645 | queue_count) + NETDEV_ALIGN_CONST) | 3645 | (queue_count - 1)) + NETDEV_ALIGN_CONST) |
3646 | & ~NETDEV_ALIGN_CONST)); | 3646 | & ~NETDEV_ALIGN_CONST)); |
3647 | } | 3647 | } |
3648 | 3648 | ||