alx: acquire mutex for alx_reinit in alx_change_mtu
authorNiels Dossche <dossche.niels@gmail.com>
Thu, 10 Mar 2022 23:27:08 +0000 (00:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Mar 2022 08:16:41 +0000 (09:16 +0100)
commit1dcc1b888223227539899e37144e30a03724e75e
treebe2e9e353d9052606ed7742e4c4c6e2f784a36a1
parent4b49ba22a25383ed6c7ce9e2c1ba12246dd618fc
alx: acquire mutex for alx_reinit in alx_change_mtu

[ Upstream commit 46b348fd2d81a341b15fb3f3f986204b038f5c42 ]

alx_reinit has a lockdep assertion that the alx->mtx mutex must be held.
alx_reinit is called from two places: alx_reset and alx_change_mtu.
alx_reset does acquire alx->mtx before calling alx_reinit.
alx_change_mtu does not acquire this mutex, nor do its callers or any
path towards alx_change_mtu.
Acquire the mutex in alx_change_mtu.

The issue was introduced when the fine-grained locking was introduced
to the code to replace the RTNL. The same commit also introduced the
lockdep assertion.

Fixes: 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL")
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
Link: https://lore.kernel.org/r/20220310232707.44251-1-dossche.niels@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/atheros/alx/main.c