All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ath6kl: Avoid null ptr dereference while printing reg domain pair
@ 2012-09-20  6:21 rmani
  2012-09-20  6:21 ` [PATCH 2/3] ath6kl: Check for valid rate table index rmani
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: rmani @ 2012-09-20  6:21 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, Raja Mani

From: Raja Mani <rmani@qca.qualcomm.com>

Return value of ath6kl_get_regpair() is stored in 'regpair' in
ath6kl_wmi_regdomain_event() func and it's directly accessed
in the debug prints without checking for NULL value. There are
situation to get NULL pointer as a return value from
ath6kl_get_regpair() func. Fix this.

Found this on code review.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/wmi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 68b46bd..d5263ff 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -936,8 +936,9 @@ static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
 
 		regpair = ath6kl_get_regpair((u16) reg_code);
 		country = ath6kl_regd_find_country_by_rd((u16) reg_code);
-		ath6kl_dbg(ATH6KL_DBG_WMI, "Regpair used: 0x%0x\n",
-			   regpair->regDmnEnum);
+		if (regpair)
+			ath6kl_dbg(ATH6KL_DBG_WMI, "Regpair used: 0x%0x\n",
+				   regpair->regDmnEnum);
 	}
 
 	if (country && wmi->parent_dev->wiphy_registered) {
-- 
1.7.1


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

end of thread, other threads:[~2012-09-21  9:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20  6:21 [PATCH 1/3] ath6kl: Avoid null ptr dereference while printing reg domain pair rmani
2012-09-20  6:21 ` [PATCH 2/3] ath6kl: Check for valid rate table index rmani
2012-09-21  9:16   ` Kalle Valo
2012-09-20  6:21 ` [PATCH 3/3] ath6kl: Check for valid endpoint ID values in ath6kl_control_tx() rmani
2012-09-21  9:18   ` Kalle Valo
2012-09-21  9:34     ` Raja Mani
2012-09-21  9:35     ` Raja Mani
2012-09-21  9:14 ` [PATCH 1/3] ath6kl: Avoid null ptr dereference while printing reg domain pair Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.