Skip to content

Commit

Permalink
taskstats: check nla_reserve() return
Browse files Browse the repository at this point in the history
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=44621

Reported-by: <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alan Cox authored and torvalds committed Jul 31, 2012
1 parent fd4b616 commit 25353b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/taskstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,11 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)

na = nla_reserve(rep_skb, CGROUPSTATS_TYPE_CGROUP_STATS,
sizeof(struct cgroupstats));
if (na == NULL) {
rc = -EMSGSIZE;
goto err;
}

stats = nla_data(na);
memset(stats, 0, sizeof(*stats));

Expand Down

0 comments on commit 25353b3

Please sign in to comment.