[PATCH net-next] devlink: Add missing check of nlmsg_put

Subsystems: networking [general], the rest

STALE2832d

2 messages, 2 authors, 2019-01-23 · open the first message on its own page

[PATCH net-next] devlink: Add missing check of nlmsg_put

From: YueHaibing <hidden>
Date: 2019-01-21 09:29:16

nlmsg_put may fail, this fix add a check of its return value.

Signed-off-by: YueHaibing <redacted>
---
 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;


Re: [PATCH net-next] devlink: Add missing check of nlmsg_put

From: David Miller <davem@davemloft.net>
Date: 2019-01-23 04:09:30

From: YueHaibing <redacted>
Date: Mon, 21 Jan 2019 09:34:53 +0000
nlmsg_put may fail, this fix add a check of its return value.

Signed-off-by: YueHaibing <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help