Commit 0d8cb946 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski

devlink: Unlock on error in dumpit()

This needs to unlock before returning.

Fixes: 544e7c33 ("net: devlink: Add support for port regions")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201026080127.GB1628785@mwandaSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6c211809
......@@ -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]);
......
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