Skip to content

Commit

Permalink
devlink: Unlock on error in dumpit()
Browse files Browse the repository at this point in the history
This needs to unlock before returning.

Fixes: 544e7c3 ("net: devlink: Add support for port regions")
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/20201026080127.GB1628785@mwanda
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Dan Carpenter authored and kuba-moo committed Oct 28, 2020
1 parent 6c21180 commit 0d8cb94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/core/devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -4919,8 +4919,10 @@ static int devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb,
index = nla_get_u32(info->attrs[DEVLINK_ATTR_PORT_INDEX]);

port = devlink_port_get_by_index(devlink, index);
if (!port)
return -ENODEV;
if (!port) {
err = -ENODEV;
goto out_unlock;
}
}

region_name = nla_data(attrs[DEVLINK_ATTR_REGION_NAME]);
Expand Down

0 comments on commit 0d8cb94

Please sign in to comment.