Commit 8ccc1131 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by David S. Miller

mlxsw: core: Fix an error handling path in 'mlxsw_core_bus_device_register()'

Resources are not freed in the reverse order of the allocation.
Labels are also mixed-up.

Fix it and reorder code and labels in the error handling path of
'mlxsw_core_bus_device_register()'

Fixes: ef3116e5 ("mlxsw: spectrum: Register KVD resources with devlink")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 89dd2e75
...@@ -1100,11 +1100,11 @@ int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, ...@@ -1100,11 +1100,11 @@ int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
err_alloc_lag_mapping: err_alloc_lag_mapping:
mlxsw_ports_fini(mlxsw_core); mlxsw_ports_fini(mlxsw_core);
err_ports_init: err_ports_init:
mlxsw_bus->fini(bus_priv);
err_bus_init:
if (!reload) if (!reload)
devlink_resources_unregister(devlink, NULL); devlink_resources_unregister(devlink, NULL);
err_register_resources: err_register_resources:
mlxsw_bus->fini(bus_priv);
err_bus_init:
if (!reload) if (!reload)
devlink_free(devlink); devlink_free(devlink);
err_devlink_alloc: err_devlink_alloc:
......
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