Commit bfd4e6a5 authored by Moshe Shemesh's avatar Moshe Shemesh Committed by Jakub Kicinski

devlink: health: Fix nla_nest_end in error flow

devlink_nl_health_reporter_fill() error flow calls nla_nest_end(). Fix
it to call nla_nest_cancel() instead.

Note the bug is harmless as genlmsg_cancel() cancel the entire message,
so no fixes tag added.
Signed-off-by: default avatarMoshe Shemesh <moshe@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b4740e3a
...@@ -6028,7 +6028,7 @@ devlink_nl_health_reporter_fill(struct sk_buff *msg, ...@@ -6028,7 +6028,7 @@ devlink_nl_health_reporter_fill(struct sk_buff *msg,
return 0; return 0;
reporter_nest_cancel: reporter_nest_cancel:
nla_nest_end(msg, reporter_attr); nla_nest_cancel(msg, reporter_attr);
genlmsg_cancel: genlmsg_cancel:
genlmsg_cancel(msg, hdr); genlmsg_cancel(msg, hdr);
return -EMSGSIZE; return -EMSGSIZE;
......
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