]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net: ethernet: mtk_wed: fix possible deadlock if mtk_wed_wo_init fails
authorLorenzo Bianconi <lorenzo@kernel.org>
Wed, 7 Dec 2022 14:04:55 +0000 (15:04 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Dec 2022 03:47:43 +0000 (19:47 -0800)
commit587585e1bbebc250d46ebb0eeaf986d9c3c01c69
treeb25ff39cdc0900ef790378b223e49d0de1f286c6
parentc79e0af5ae5e4de98595983fc7e883e2ca54db11
net: ethernet: mtk_wed: fix possible deadlock if mtk_wed_wo_init fails

Introduce __mtk_wed_detach() in order to avoid a deadlock in
mtk_wed_attach routine if mtk_wed_wo_init fails since both
mtk_wed_attach and mtk_wed_detach run holding hw_lock mutex.

Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mediatek/mtk_wed.c