projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f02147e
)
kernel/taskstats.c: add nla_nest_cancel() for failure processing between nla_nest_sta...
author
Chen Gang
<
[email protected]
>
Tue, 12 Nov 2013 23:11:22 +0000
(15:11 -0800)
committer
Linus Torvalds
<
[email protected]
>
Wed, 13 Nov 2013 03:09:33 +0000
(12:09 +0900)
When failure occurs between nla_nest_start() and nla_nest_end(), we should
call nla_nest_cancel() to clean up related things.
Signed-off-by: Chen Gang <
[email protected]
>
Cc: Balbir Singh <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
kernel/taskstats.c
patch
|
blob
|
history
diff --git
a/kernel/taskstats.c
b/kernel/taskstats.c
index 145bb4d3bd4d9569fb38b33d9afe3496325a6a57..1db6808c494bdab43e826b2c2a580a5354f9ac94 100644
(file)
--- a/
kernel/taskstats.c
+++ b/
kernel/taskstats.c
@@
-404,11
+404,15
@@
static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid)
if (!na)
goto err;
- if (nla_put(skb, type, sizeof(pid), &pid) < 0)
+ if (nla_put(skb, type, sizeof(pid), &pid) < 0) {
+ nla_nest_cancel(skb, na);
goto err;
+ }
ret = nla_reserve(skb, TASKSTATS_TYPE_STATS, sizeof(struct taskstats));
- if (!ret)
+ if (!ret) {
+ nla_nest_cancel(skb, na);
goto err;
+ }
nla_nest_end(skb, na);
return nla_data(ret);