Skip to content

Commit

Permalink
devlink: use nla_put_failure goto label instead of out
Browse files Browse the repository at this point in the history
Be aligned with the rest of the code and use label named nla_put_failure.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Feb 10, 2017
1 parent 21e3d2d commit 1a6aa36
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/core/devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,29 +1408,29 @@ static int devlink_nl_eswitch_fill(struct sk_buff *msg, struct devlink *devlink,

err = devlink_nl_put_handle(msg, devlink);
if (err)
goto out;
goto nla_put_failure;

err = ops->eswitch_mode_get(devlink, &mode);
if (err)
goto out;
goto nla_put_failure;
err = nla_put_u16(msg, DEVLINK_ATTR_ESWITCH_MODE, mode);
if (err)
goto out;
goto nla_put_failure;

if (ops->eswitch_inline_mode_get) {
err = ops->eswitch_inline_mode_get(devlink, &inline_mode);
if (err)
goto out;
goto nla_put_failure;
err = nla_put_u8(msg, DEVLINK_ATTR_ESWITCH_INLINE_MODE,
inline_mode);
if (err)
goto out;
goto nla_put_failure;
}

genlmsg_end(msg, hdr);
return 0;

out:
nla_put_failure:
genlmsg_cancel(msg, hdr);
return err;
}
Expand Down

0 comments on commit 1a6aa36

Please sign in to comment.