diff mbox series

wifi: iwlwifi: drop NULL pointer check in iwl_mvm_tzone_set_trip_temp()

Message ID 20231003092048.24998-1-dmantipov@yandex.ru (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series wifi: iwlwifi: drop NULL pointer check in iwl_mvm_tzone_set_trip_temp() | expand

Commit Message

Dmitry Antipov Oct. 3, 2023, 9:20 a.m. UTC
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>
---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Greenman, Gregory Oct. 4, 2023, 7:55 a.m. UTC | #1
On Tue, 2023-10-03 at 12:20 +0300, Dmitry Antipov wrote:
> 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>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> index 157e96fa23c1..dee9c367dcd3 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> @@ -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);

Acked-by: Gregory Greenman <gregory.greenman@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 157e96fa23c1..dee9c367dcd3 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -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);