Linux wireless drivers development
 help / color / mirror / Atom feed
* [bug report] wifi: iwlwifi: support fast resume
@ 2024-11-12  9:44 Dan Carpenter
  2024-11-12 15:03 ` Grumbach, Emmanuel
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2024-11-12  9:44 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: linux-wireless

Hello Emmanuel Grumbach,

Commit e8bb19c1d590 ("wifi: iwlwifi: support fast resume") from Jun
18, 2024 (linux-next), leads to the following Smatch static checker
warning:

	drivers/net/wireless/intel/iwlwifi/mvm/d3.c:3121 iwl_mvm_check_rt_status()
	error: uninitialized symbol 'err_id'.

drivers/net/wireless/intel/iwlwifi/mvm/d3.c
    3112 static bool iwl_mvm_check_rt_status(struct iwl_mvm *mvm,
    3113                                    struct ieee80211_vif *vif)
    3114 {
    3115         u32 err_id;
    3116 
    3117         /* check for lmac1 error */
    3118         if (iwl_fwrt_read_err_table(mvm->trans,
    3119                                     mvm->trans->dbg.lmac_error_event_table[0],
    3120                                     &err_id)) {

iwl_fwrt_read_err_table() returns true on failure (meaning that we weren't able
to read the error table so maybe that the two errors cancel each other (double
negative) so there wasn't an error?)  Anyway if iwl_trans_read_mem_bytes() fails
then "err_id" is not initialized.

--> 3121                 if (err_id == RF_KILL_INDICATOR_FOR_WOWLAN && vif) {
    3122                         struct cfg80211_wowlan_wakeup wakeup = {
    3123                                 .rfkill_release = true,
    3124                         };
    3125                         ieee80211_report_wowlan_wakeup(vif, &wakeup,
    3126                                                        GFP_KERNEL);
    3127                 }
    3128                 return true;
    3129         }
    3130 
    3131         /* check if we have lmac2 set and check for error */
    3132         if (iwl_fwrt_read_err_table(mvm->trans,
    3133                                     mvm->trans->dbg.lmac_error_event_table[1],
    3134                                     NULL))
    3135                 return true;
    3136 
    3137         /* check for umac error */
    3138         if (iwl_fwrt_read_err_table(mvm->trans,
    3139                                     mvm->trans->dbg.umac_error_event_table,
    3140                                     NULL))
    3141                 return true;
    3142 
    3143         return false;
    3144 }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [bug report] wifi: iwlwifi: support fast resume
  2024-11-12  9:44 [bug report] wifi: iwlwifi: support fast resume Dan Carpenter
@ 2024-11-12 15:03 ` Grumbach, Emmanuel
  2024-11-12 15:09   ` Grumbach, Emmanuel
  0 siblings, 1 reply; 3+ messages in thread
From: Grumbach, Emmanuel @ 2024-11-12 15:03 UTC (permalink / raw)
  To: dan.carpenter@linaro.org; +Cc: linux-wireless@vger.kernel.org

Hello Dan,

On Tue, 2024-11-12 at 12:44 +0300, Dan Carpenter wrote:
> Hello Emmanuel Grumbach,
> 
> Commit e8bb19c1d590 ("wifi: iwlwifi: support fast resume") from Jun
> 18, 2024 (linux-next), leads to the following Smatch static checker
> warning:
> 
> 	drivers/net/wireless/intel/iwlwifi/mvm/d3.c:3121
> iwl_mvm_check_rt_status()
> 	error: uninitialized symbol 'err_id'.
> 
> drivers/net/wireless/intel/iwlwifi/mvm/d3.c
>     3112 static bool iwl_mvm_check_rt_status(struct iwl_mvm *mvm,
>     3113                                    struct ieee80211_vif
> *vif)
>     3114 {
>     3115         u32 err_id;
>     3116 
>     3117         /* check for lmac1 error */
>     3118         if (iwl_fwrt_read_err_table(mvm->trans,
>     3119                                     mvm->trans-
> >dbg.lmac_error_event_table[0],
>     3120                                     &err_id)) {
> 
> iwl_fwrt_read_err_table() returns true on failure (meaning that we
> weren't able
> to read the error table so maybe that the two errors cancel each
> other (double
> negative) so there wasn't an error?)  Anyway if
> iwl_trans_read_mem_bytes() fails
> then "err_id" is not initialized.

Thanks for this report.
I'll send a patch internally to fix this.

> 
> --> 3121                 if (err_id == RF_KILL_INDICATOR_FOR_WOWLAN
> && vif) {
>     3122                         struct cfg80211_wowlan_wakeup wakeup
> = {
>     3123                                 .rfkill_release = true,
>     3124                         };
>     3125                         ieee80211_report_wowlan_wakeup(vif,
> &wakeup,
>     3126                                                       
> GFP_KERNEL);
>     3127                 }
>     3128                 return true;
>     3129         }
>     3130 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [bug report] wifi: iwlwifi: support fast resume
  2024-11-12 15:03 ` Grumbach, Emmanuel
@ 2024-11-12 15:09   ` Grumbach, Emmanuel
  0 siblings, 0 replies; 3+ messages in thread
From: Grumbach, Emmanuel @ 2024-11-12 15:09 UTC (permalink / raw)
  To: dan.carpenter@linaro.org; +Cc: linux-wireless@vger.kernel.org

On Tue, 2024-11-12 at 17:03 +0200, Grumbach, Emmanuel wrote:
> Hello Dan,
> 
> On Tue, 2024-11-12 at 12:44 +0300, Dan Carpenter wrote:
> > Hello Emmanuel Grumbach,
> > 
> > Commit e8bb19c1d590 ("wifi: iwlwifi: support fast resume") from Jun
> > 18, 2024 (linux-next), leads to the following Smatch static checker
> > warning:
> > 
> > 	drivers/net/wireless/intel/iwlwifi/mvm/d3.c:3121
> > iwl_mvm_check_rt_status()
> > 	error: uninitialized symbol 'err_id'.
> > 
> > drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> >     3112 static bool iwl_mvm_check_rt_status(struct iwl_mvm *mvm,
> >     3113                                    struct ieee80211_vif
> > *vif)
> >     3114 {
> >     3115         u32 err_id;
> >     3116 
> >     3117         /* check for lmac1 error */
> >     3118         if (iwl_fwrt_read_err_table(mvm->trans,
> >     3119                                     mvm->trans-
> > > dbg.lmac_error_event_table[0],
> >     3120                                     &err_id)) {
> > 
> > iwl_fwrt_read_err_table() returns true on failure (meaning that we
> > weren't able
> > to read the error table so maybe that the two errors cancel each
> > other (double
> > negative) so there wasn't an error?)  Anyway if
> > iwl_trans_read_mem_bytes() fails
> > then "err_id" is not initialized.
> 
> Thanks for this report.
> I'll send a patch internally to fix this.

Actually we already have a fix merged internally:

https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git/commit/?id=d9b99edcf0616a284860071a2eaa3b4b2da1e577

> 
> > 
> > --> 3121                 if (err_id == RF_KILL_INDICATOR_FOR_WOWLAN
> > && vif) {
> >     3122                         struct cfg80211_wowlan_wakeup
> > wakeup
> > = {
> >     3123                                 .rfkill_release = true,
> >     3124                         };
> >     3125                        
> > ieee80211_report_wowlan_wakeup(vif,
> > &wakeup,
> >     3126                                                       
> > GFP_KERNEL);
> >     3127                 }
> >     3128                 return true;
> >     3129         }
> >     3130 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-12 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12  9:44 [bug report] wifi: iwlwifi: support fast resume Dan Carpenter
2024-11-12 15:03 ` Grumbach, Emmanuel
2024-11-12 15:09   ` Grumbach, Emmanuel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox