Commit 0ae646845b603e9df5711084436d389f8371ffb3

Authored by Balbir Singh
Committed by Linus Torvalds
1 parent 17db952cd1

[PATCH] Fix taskstats size calculation (use the new genetlink utility functions)

The addition of the CSA patch pushed the size of struct taskstats to 256
bytes.  This exposed a problem with prepare_reply(), we were not allocating
space for the netlink and genetlink header.  It worked earlier because
alloc_skb() would align the skb to SMP_CACHE_BYTES, which added some additonal
bytes.

Signed-off-by: Balbir Singh <balbir@in.ibm.com>
Cc: Jamal Hadi <hadi@cyberus.ca>
Cc: Shailabh Nagar <nagar@watson.ibm.com>
Cc: Thomas Graf <tgraf@suug.ch>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jay Lan <jlan@engr.sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -75,7 +75,7 @@
75 75 /*
76 76 * If new attributes are added, please revisit this allocation
77 77 */
78   - skb = nlmsg_new(size, GFP_KERNEL);
  78 + skb = nlmsg_new(genlmsg_total_size(size), GFP_KERNEL);
79 79 if (!skb)
80 80 return -ENOMEM;
81 81