]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Oct 2022 12:25:43 +0000 (13:25 +0100)
commitdef3be054cd7c5bd7cb50f81fff333a1c011332c
tree5c8acf7fa5d1d0d2b67ad896491db7afe4c60400
parentd1f9622c86d4c2f4060a61c5d87f2e5ed40738a8
net: wwan: iosm: Call mutex_init before locking it

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: 1aa44bf7159c ("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>
drivers/net/wwan/iosm/iosm_ipc_wwan.c