diff options
Diffstat (limited to 'kernel/taskstats.c')
-rw-r--r-- | kernel/taskstats.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index 11281d5792bd..5a651aa63d61 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
@@ -360,6 +360,12 @@ static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid) | |||
360 | struct nlattr *na, *ret; | 360 | struct nlattr *na, *ret; |
361 | int aggr; | 361 | int aggr; |
362 | 362 | ||
363 | /* If we don't pad, we end up with alignment on a 4 byte boundary. | ||
364 | * This causes lots of runtime warnings on systems requiring 8 byte | ||
365 | * alignment */ | ||
366 | u32 pids[2] = { pid, 0 }; | ||
367 | int pid_size = ALIGN(sizeof(pid), sizeof(long)); | ||
368 | |||
363 | aggr = (type == TASKSTATS_TYPE_PID) | 369 | aggr = (type == TASKSTATS_TYPE_PID) |
364 | ? TASKSTATS_TYPE_AGGR_PID | 370 | ? TASKSTATS_TYPE_AGGR_PID |
365 | : TASKSTATS_TYPE_AGGR_TGID; | 371 | : TASKSTATS_TYPE_AGGR_TGID; |
@@ -367,7 +373,7 @@ static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid) | |||
367 | na = nla_nest_start(skb, aggr); | 373 | na = nla_nest_start(skb, aggr); |
368 | if (!na) | 374 | if (!na) |
369 | goto err; | 375 | goto err; |
370 | if (nla_put(skb, type, sizeof(pid), &pid) < 0) | 376 | if (nla_put(skb, type, pid_size, pids) < 0) |
371 | goto err; | 377 | goto err; |
372 | ret = nla_reserve(skb, TASKSTATS_TYPE_STATS, sizeof(struct taskstats)); | 378 | ret = nla_reserve(skb, TASKSTATS_TYPE_STATS, sizeof(struct taskstats)); |
373 | if (!ret) | 379 | if (!ret) |