summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoshe Shemesh <moshe@nvidia.com>2023-02-14 18:37:58 +0200
committerJakub Kicinski <kuba@kernel.org>2023-02-15 19:15:44 -0800
commitbfd4e6a5dbbc12f77620602e764ac940ccb159de (patch)
treec98029797739fe929be309d9d5d0982aeb6f1e6d
parentb4740e3a8137faa5831c690d0bf0b46f41008baf (diff)
downloadlwn-bfd4e6a5dbbc12f77620602e764ac940ccb159de.tar.gz
lwn-bfd4e6a5dbbc12f77620602e764ac940ccb159de.zip
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: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--net/devlink/leftover.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c
index cfd1b90a0fc1..90f95f06de28 100644
--- a/net/devlink/leftover.c
+++ b/net/devlink/leftover.c
@@ -6028,7 +6028,7 @@ devlink_nl_health_reporter_fill(struct sk_buff *msg,
return 0;
reporter_nest_cancel:
- nla_nest_end(msg, reporter_attr);
+ nla_nest_cancel(msg, reporter_attr);
genlmsg_cancel:
genlmsg_cancel(msg, hdr);
return -EMSGSIZE;