OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56431e3
)
devlink: Add missing check of nlmsg_put
author
YueHaibing
<yuehaibing@huawei.com>
Mon, 21 Jan 2019 09:34:53 +0000
(09:34 +0000)
committer
David S. Miller
<davem@davemloft.net>
Wed, 23 Jan 2019 04:08:23 +0000
(20:08 -0800)
nlmsg_put may fail, this fix add a check of its return value.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c
patch
|
blob
|
history
diff --git
a/net/core/devlink.c
b/net/core/devlink.c
index
60248a5
..
059575c
100644
(file)
--- a/
net/core/devlink.c
+++ b/
net/core/devlink.c
@@
-4086,6
+4086,9
@@
devlink_health_buffer_snd(struct genl_info *info,
return -ENOMEM;
nlh = nlmsg_put(skb, info->snd_portid, info->snd_seq,
NLMSG_DONE, 0, flags | NLM_F_MULTI);
+ if (!nlh)
+ goto nla_put_failure;
+
err = genlmsg_reply(skb, info);
if (err)
return err;