From: "Guy, Wey-Yi" <wey-yi.w.guy@intel.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] iwlwifi: assume vif is NULL for internal scans and non-NULL otherwise
Date: Thu, 22 Jul 2010 12:36:39 -0700 [thread overview]
Message-ID: <1279827399.9034.0.camel@wwguy-ubuntu> (raw)
In-Reply-To: <1279826937-24581-1-git-send-email-linville@tuxdriver.com>
Hi John,
On Thu, 2010-07-22 at 12:28 -0700, John W. Linville wrote:
> The current practice of checking vif for NULL in one place but not
> another seems to confuse some static checkers, smatch in particular.
> Since vif will only be NULL in the case of internal scans, adjust the
> checks accordingly.
>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
> drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 5 ++++-
> drivers/net/wireless/iwlwifi/iwl3945-base.c | 5 ++++-
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> index 74623e0..0ca0df4 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> @@ -1234,7 +1234,10 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
>
> IWL_DEBUG_INFO(priv, "Scanning while associated...\n");
> spin_lock_irqsave(&priv->lock, flags);
> - interval = vif ? vif->bss_conf.beacon_int : 0;
> + if (priv->is_internal_short_scan)
> + interval = 0;
> + else
> + interval = vif->bss_conf.beacon_int;
> spin_unlock_irqrestore(&priv->lock, flags);
>
> scan->suspend_time = 0;
> diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> index 8eb3471..b102bab 100644
> --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
> +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> @@ -2883,7 +2883,10 @@ void iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
> IWL_DEBUG_INFO(priv, "Scanning while associated...\n");
>
> spin_lock_irqsave(&priv->lock, flags);
> - interval = vif ? vif->bss_conf.beacon_int : 0;
> + if (priv->is_internal_short_scan)
> + interval = 0;
> + else
> + interval = vif->bss_conf.beacon_int;
> spin_unlock_irqrestore(&priv->lock, flags);
>
> scan->suspend_time = 0;
Make sense, Thanks.
Wey
prev parent reply other threads:[~2010-07-22 19:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-21 22:16 potential null deref in iwlagn_request_scan()? Dan Carpenter
2010-07-22 19:28 ` John W. Linville
2010-07-22 19:28 ` [PATCH] iwlwifi: assume vif is NULL for internal scans and non-NULL otherwise John W. Linville
2010-07-22 19:36 ` Guy, Wey-Yi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1279827399.9034.0.camel@wwguy-ubuntu \
--to=wey-yi.w.guy@intel.com \
--cc=error27@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).