Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90899
b: refs/heads/master
c: d1643d2
h: refs/heads/master
i:
  90897: bbb05aa
  90895: bb9ae07
v: v3
  • Loading branch information
Alexey Dobriyan authored and David S. Miller committed Apr 18, 2008
1 parent a146a64 commit 64c8376
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c051235a7f115c34e675c9cf55820bd3435f860
refs/heads/master: d1643d24c61b725bef399cc1cf2944b4c9c23177
15 changes: 9 additions & 6 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3996,12 +3996,15 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,

BUG_ON(strlen(name) >= sizeof(dev->name));

/* ensure 32-byte alignment of both the device and private area */
alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST +
(sizeof(struct net_device_subqueue) * (queue_count - 1))) &
~NETDEV_ALIGN_CONST;
if (sizeof_priv)
alloc_size += sizeof_priv + NETDEV_ALIGN_CONST;
alloc_size = sizeof(struct net_device) +
sizeof(struct net_device_subqueue) * (queue_count - 1);
if (sizeof_priv) {
/* ensure 32-byte alignment of private area */
alloc_size = (alloc_size + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST;
alloc_size += sizeof_priv;
}
/* ensure 32-byte alignment of whole construct */
alloc_size += NETDEV_ALIGN_CONST;

p = kzalloc(alloc_size, GFP_KERNEL);
if (!p) {
Expand Down

0 comments on commit 64c8376

Please sign in to comment.