[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1548063293-17855-1-git-send-email-yuehaibing@huawei.com>
Date: Mon, 21 Jan 2019 09:34:53 +0000
From: YueHaibing <yuehaibing@...wei.com>
To: Jiri Pirko <jiri@...lanox.com>,
"David S. Miller" <davem@...emloft.net>
CC: YueHaibing <yuehaibing@...wei.com>, <netdev@...r.kernel.org>,
<kernel-janitors@...r.kernel.org>
Subject: [PATCH net-next] 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@...wei.com>
---
net/core/devlink.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 60248a5..059575c 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4086,6 +4086,9 @@ void devlink_health_buffer_nest_cancel(struct devlink_health_buffer *buffer)
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;
Powered by blists - more mailing lists