summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-01-21 09:34:53 +0000
committerDavid S. Miller <davem@davemloft.net>2019-01-22 20:08:23 -0800
commited175d9c6f0d4df0f83f22ff4c887c21b7d021cd (patch)
treec500be1467745a7004d29e7a0603421d1c75cb90 /net/core
parent56431e38efe971591180cd7af7c28ac4b970de5c (diff)
devlink: Add missing check of nlmsg_put
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>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/devlink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 60248a53c0ad..059575c85dde 100644
--- 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;