提交 8ccc1131 编写于 作者: C Christophe JAILLET 提交者: 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: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册