mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
mlxsw: destroy workqueue when trap_register in mlxsw_emad_init
When mlxsw_core_trap_register fails in mlxsw_emad_init,
destroy_workqueue() shouled be called to destroy mlxsw_core->emad_wq.
Fixes: d965465b60
("mlxsw: core: Fix possible deadlock")
Signed-off-by: Liu Jian <liujian56@huawei.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6790711f8a
commit
5dbaeb87f2
@ -710,7 +710,7 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core)
|
||||
err = mlxsw_core_trap_register(mlxsw_core, &mlxsw_emad_rx_listener,
|
||||
mlxsw_core);
|
||||
if (err)
|
||||
return err;
|
||||
goto err_trap_register;
|
||||
|
||||
err = mlxsw_core->driver->basic_trap_groups_set(mlxsw_core);
|
||||
if (err)
|
||||
@ -722,6 +722,7 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core)
|
||||
err_emad_trap_set:
|
||||
mlxsw_core_trap_unregister(mlxsw_core, &mlxsw_emad_rx_listener,
|
||||
mlxsw_core);
|
||||
err_trap_register:
|
||||
destroy_workqueue(mlxsw_core->emad_wq);
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user