linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath6kl: check for sband existence when creating scan cmd
@ 2012-04-24 19:50 Thomas Pedersen
  2012-04-25  6:38 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Pedersen @ 2012-04-24 19:50 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl-devel, linux-wireless, Thomas Pedersen

The patch "ath6kl: support fw reporting phy capabilities" gave the
firmware the ability to disable certain wiphy supported bands. Check if
this is the case in ath6kl_wmi_beginscan_cmd to avoid dereferencing a
NULL pointer.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/wmi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 2eb771a..9186f8e 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -1851,6 +1851,8 @@ int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
 	for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
 		struct ieee80211_supported_band *sband =
 		    ar->wiphy->bands[band];
+		if (!sband)
+			continue;
 		u32 ratemask = rates[band];
 		u8 *supp_rates = sc->supp_rates[band].rates;
 		num_rates = 0;
-- 
1.7.4.1


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

* Re: [PATCH] ath6kl: check for sband existence when creating scan cmd
  2012-04-24 19:50 [PATCH] ath6kl: check for sband existence when creating scan cmd Thomas Pedersen
@ 2012-04-25  6:38 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2012-04-25  6:38 UTC (permalink / raw)
  To: Thomas Pedersen; +Cc: ath6kl-devel, linux-wireless

On 04/24/2012 10:50 PM, Thomas Pedersen wrote:
> The patch "ath6kl: support fw reporting phy capabilities" gave the
> firmware the ability to disable certain wiphy supported bands. Check if
> this is the case in ath6kl_wmi_beginscan_cmd to avoid dereferencing a
> NULL pointer.
> 
> Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>

Thanks, applied with changes. I really didn't like mixing code and
declarations so I changed the code a bit and added few empty lines for
readibility. There shouldn't be any functional changes but please do
check my changes.

Kalle

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

end of thread, other threads:[~2012-04-25  6:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-24 19:50 [PATCH] ath6kl: check for sband existence when creating scan cmd Thomas Pedersen
2012-04-25  6:38 ` Kalle Valo

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).