iwlwifi: tt: move ucode_loaded check under mutex
authorJohannes Berg <johannes.berg@intel.com>
Wed, 22 Mar 2017 21:00:10 +0000 (22:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:48:20 +0000 (19:48 +0200)
commit87a9c569fea9d88a5a47064a9fb6720707010114
treec488f3d08260f3da513f2cd61ee47dc65f452e8a
parent6dc9a4b33b355c4bddb994b0abf1982a798ea1f4
iwlwifi: tt: move ucode_loaded check under mutex

[ Upstream commit d9954405758a0cbbe258d9b4d4dc12a06fa48a28 ]

The ucode_loaded check should be under the mutex, since it can
otherwise change state after we looked at it and before we got
the mutex. Fix that.

Fixes: 5c89e7bc557e ("iwlwifi: mvm: add registration to cooling device")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/intel/iwlwifi/mvm/tt.c