Commit 1a6aa36b authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

devlink: use nla_put_failure goto label instead of out

Be aligned with the rest of the code and use label named nla_put_failure.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 21e3d2dd
...@@ -1408,29 +1408,29 @@ static int devlink_nl_eswitch_fill(struct sk_buff *msg, struct devlink *devlink, ...@@ -1408,29 +1408,29 @@ static int devlink_nl_eswitch_fill(struct sk_buff *msg, struct devlink *devlink,
err = devlink_nl_put_handle(msg, devlink); err = devlink_nl_put_handle(msg, devlink);
if (err) if (err)
goto out; goto nla_put_failure;
err = ops->eswitch_mode_get(devlink, &mode); err = ops->eswitch_mode_get(devlink, &mode);
if (err) if (err)
goto out; goto nla_put_failure;
err = nla_put_u16(msg, DEVLINK_ATTR_ESWITCH_MODE, mode); err = nla_put_u16(msg, DEVLINK_ATTR_ESWITCH_MODE, mode);
if (err) if (err)
goto out; goto nla_put_failure;
if (ops->eswitch_inline_mode_get) { if (ops->eswitch_inline_mode_get) {
err = ops->eswitch_inline_mode_get(devlink, &inline_mode); err = ops->eswitch_inline_mode_get(devlink, &inline_mode);
if (err) if (err)
goto out; goto nla_put_failure;
err = nla_put_u8(msg, DEVLINK_ATTR_ESWITCH_INLINE_MODE, err = nla_put_u8(msg, DEVLINK_ATTR_ESWITCH_INLINE_MODE,
inline_mode); inline_mode);
if (err) if (err)
goto out; goto nla_put_failure;
} }
genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
return 0; return 0;
out: nla_put_failure:
genlmsg_cancel(msg, hdr); genlmsg_cancel(msg, hdr);
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