Skip to content

Commit

Permalink
devlink: Add missing check of nlmsg_put
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YueHaibing authored and David S. Miller committed Jan 23, 2019
1 parent 56431e3 commit ed175d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/core/devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ed175d9

Please sign in to comment.