wifi: iwlwifi: drop NULL pointer check in iwl_mvm_tzone_set_trip_temp()
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 3 Oct 2023 09:20:46 +0000 (12:20 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 23 Oct 2023 10:50:21 +0000 (12:50 +0200)
Since 'tz_device' is an in-place member of 'struct iwl_mvm', it can't
be NULL and so relevant check may be dropped. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231003092048.24998-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/tt.c

index 157e96fa23c1ac7e4ff9140995eefde86483addb..dee9c367dcd3576a47b0a7d2b8b69cc2d1cc6651 100644 (file)
@@ -642,7 +642,6 @@ static int iwl_mvm_tzone_set_trip_temp(struct thermal_zone_device *device,
                                       int trip, int temp)
 {
        struct iwl_mvm *mvm = thermal_zone_device_priv(device);
-       struct iwl_mvm_thermal_device *tzone;
        int ret;
 
        mutex_lock(&mvm->mutex);
@@ -658,12 +657,6 @@ static int iwl_mvm_tzone_set_trip_temp(struct thermal_zone_device *device,
                goto out;
        }
 
-       tzone = &mvm->tz_device;
-       if (!tzone) {
-               ret = -EIO;
-               goto out;
-       }
-
        ret = iwl_mvm_send_temp_report_ths_cmd(mvm);
 out:
        mutex_unlock(&mvm->mutex);