]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: wwan: iosm: Call mutex_init before locking it
authorMaxim Mikityanskiy <maxtram95@gmail.com>
Sat, 1 Oct 2022 10:57:13 +0000 (13:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:57:16 +0000 (09:57 +0200)
commit39365e1b0eb56cd221c7b1c5ff7a59c2a1e91a56
tree9b19c38bee7642666ced21e76eee794c172ff6a1
parentb47bc8202b31a2677a344322b3c4b7f8750c5e66
net: wwan: iosm: Call mutex_init before locking it

[ Upstream commit ba0fbdb95da5ddd8db457ce6ba09d16dd979a294 ]

wwan_register_ops calls wwan_create_default_link, which ends up in the
ipc_wwan_newlink callback that locks ipc_wwan->if_mutex. However, this
mutex is not yet initialized by that point. Fix it by moving mutex_init
above the wwan_register_ops call. This also makes the order of
operations in ipc_wwan_init symmetric to ipc_wwan_deinit.

Fixes: 83068395bbfc ("net: iosm: create default link via WWAN core")
Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Reviewed-by: M Chetan Kumar <m.chetan.kumar@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wwan/iosm/iosm_ipc_wwan.c