Commit ed175d9c authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

devlink: Add missing check of nlmsg_put

nlmsg_put may fail, this fix add a check of its return value.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 56431e38
...@@ -4086,6 +4086,9 @@ devlink_health_buffer_snd(struct genl_info *info, ...@@ -4086,6 +4086,9 @@ devlink_health_buffer_snd(struct genl_info *info,
return -ENOMEM; return -ENOMEM;
nlh = nlmsg_put(skb, info->snd_portid, info->snd_seq, nlh = nlmsg_put(skb, info->snd_portid, info->snd_seq,
NLMSG_DONE, 0, flags | NLM_F_MULTI); NLMSG_DONE, 0, flags | NLM_F_MULTI);
if (!nlh)
goto nla_put_failure;
err = genlmsg_reply(skb, info); err = genlmsg_reply(skb, info);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment