mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
devlink: clear flag on port register error path
When xarray insertion fails, clear the flag. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20230808082020.1363497-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
2c0e9f3806
commit
832140804e
@ -6829,8 +6829,10 @@ int devl_port_register_with_ops(struct devlink *devlink,
|
||||
spin_lock_init(&devlink_port->type_lock);
|
||||
INIT_LIST_HEAD(&devlink_port->reporter_list);
|
||||
err = xa_insert(&devlink->ports, port_index, devlink_port, GFP_KERNEL);
|
||||
if (err)
|
||||
if (err) {
|
||||
devlink_port->registered = false;
|
||||
return err;
|
||||
}
|
||||
|
||||
INIT_DELAYED_WORK(&devlink_port->type_warn_dw, &devlink_port_type_warn);
|
||||
devlink_port_type_warn_schedule(devlink_port);
|
||||
|
Loading…
Reference in New Issue
Block a user