From: YueHaibing Date: Mon, 21 Jan 2019 09:34:53 +0000 (+0000) Subject: devlink: Add missing check of nlmsg_put X-Git-Tag: Ubuntu-5.10.0-12.13~5929^2~457 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ed175d9c6f0d4df0f83f22ff4c887c21b7d021cd;p=mirror_ubuntu-hirsute-kernel.git devlink: Add missing check of nlmsg_put nlmsg_put may fail, this fix add a check of its return value. Signed-off-by: YueHaibing Signed-off-by: David S. Miller --- 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;