Commit 83214080 authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

devlink: clear flag on port register error path

When xarray insertion fails, clear the flag.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20230808082020.1363497-1-jiri@resnulli.usSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2c0e9f38
...@@ -6829,8 +6829,10 @@ int devl_port_register_with_ops(struct devlink *devlink, ...@@ -6829,8 +6829,10 @@ int devl_port_register_with_ops(struct devlink *devlink,
spin_lock_init(&devlink_port->type_lock); spin_lock_init(&devlink_port->type_lock);
INIT_LIST_HEAD(&devlink_port->reporter_list); INIT_LIST_HEAD(&devlink_port->reporter_list);
err = xa_insert(&devlink->ports, port_index, devlink_port, GFP_KERNEL); err = xa_insert(&devlink->ports, port_index, devlink_port, GFP_KERNEL);
if (err) if (err) {
devlink_port->registered = false;
return err; return err;
}
INIT_DELAYED_WORK(&devlink_port->type_warn_dw, &devlink_port_type_warn); INIT_DELAYED_WORK(&devlink_port->type_warn_dw, &devlink_port_type_warn);
devlink_port_type_warn_schedule(devlink_port); devlink_port_type_warn_schedule(devlink_port);
......
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