Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218610
b: refs/heads/master
c: 8589312
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Mahoney authored and Linus Torvalds committed Oct 28, 2010
1 parent 99f3e7d commit 6a6f417
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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: db9e5679d6aecb17253f41bd06d98194800f9c01
refs/heads/master: 85893120699f8bae8caa12a8ee18ab5fceac978e
8 changes: 7 additions & 1 deletion trunk/kernel/taskstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,20 @@ static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid)
struct nlattr *na, *ret;
int aggr;

/* If we don't pad, we end up with alignment on a 4 byte boundary.
* This causes lots of runtime warnings on systems requiring 8 byte
* alignment */
u32 pids[2] = { pid, 0 };
int pid_size = ALIGN(sizeof(pid), sizeof(long));

aggr = (type == TASKSTATS_TYPE_PID)
? TASKSTATS_TYPE_AGGR_PID
: TASKSTATS_TYPE_AGGR_TGID;

na = nla_nest_start(skb, aggr);
if (!na)
goto err;
if (nla_put(skb, type, sizeof(pid), &pid) < 0)
if (nla_put(skb, type, pid_size, pids) < 0)
goto err;
ret = nla_reserve(skb, TASKSTATS_TYPE_STATS, sizeof(struct taskstats));
if (!ret)
Expand Down

0 comments on commit 6a6f417

Please sign in to comment.