linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] atheros: fix propagation of bad EEPROM on regulatory init
@ 2009-04-14  1:41 Luis R. Rodriguez
  2009-04-21 19:40 ` [stable] " Chris Wright
  0 siblings, 1 reply; 2+ messages in thread
From: Luis R. Rodriguez @ 2009-04-14  1:41 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, chunkeey, me, Luis R. Rodriguez, stable

When the EEPROM is not in good condition we cannot continue so
we currently bail out but only ath5k is bailing out properly.
Both ath9k and ar9170 were proceeding and if a user were to run
into this they'd see an obscure panic. Lets propagate the error
as intended and make sure we inform the user by lifting the
error message from debug to a kernel error.

Stable note: You can find a port of this page here:

http://bombadil.infradead.org/~mcgrof/patches/ath9k/ath9k-fix-eeprom.patch.txt

Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ar9170/main.c |    2 ++
 drivers/net/wireless/ath/ath9k/main.c  |    5 +++--
 drivers/net/wireless/ath/regd.c        |    2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index d40cfae..767a981 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -1648,6 +1648,8 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev)
 
 	err = ath_regd_init(&ar->regulatory, ar->hw->wiphy,
 			    ar9170_reg_notifier);
+	if (err)
+		goto err_out;
 
 	err = ieee80211_register_hw(ar->hw);
 	if (err)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 9a196c1..d72768a 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1418,8 +1418,9 @@ static int ath_init(u16 devid, struct ath_softc *sc)
 	for (i = 0; i < sc->keymax; i++)
 		ath9k_hw_keyreset(ah, (u16) i);
 
-	if (ath_regd_init(&sc->sc_ah->regulatory, sc->hw->wiphy,
-			  ath9k_reg_notifier))
+	error = ath_regd_init(&sc->sc_ah->regulatory, sc->hw->wiphy,
+			      ath9k_reg_notifier);
+	if (error)
 		goto bad;
 
 	/* default to MONITOR mode */
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index a90c7cf..458c629 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -479,7 +479,7 @@ ath_regd_init(struct ath_regulatory *reg,
 	u16 regdmn;
 
 	if (!ath_regd_is_eeprom_valid(reg)) {
-		printk(KERN_DEBUG "ath: Invalid EEPROM contents\n");
+		printk(KERN_ERR "ath: Invalid EEPROM contents\n");
 		return -EINVAL;
 	}
 
-- 
1.6.0.6


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

* Re: [stable] [PATCH] atheros: fix propagation of bad EEPROM on regulatory init
  2009-04-14  1:41 [PATCH] atheros: fix propagation of bad EEPROM on regulatory init Luis R. Rodriguez
@ 2009-04-21 19:40 ` Chris Wright
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Wright @ 2009-04-21 19:40 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linville, chunkeey, me, linux-wireless, stable

* Luis R. Rodriguez (lrodriguez@atheros.com) wrote:
> When the EEPROM is not in good condition we cannot continue so
> we currently bail out but only ath5k is bailing out properly.
> Both ath9k and ar9170 were proceeding and if a user were to run
> into this they'd see an obscure panic. Lets propagate the error
> as intended and make sure we inform the user by lifting the
> error message from debug to a kernel error.

Looks like this still isn't upstream.

> Stable note: You can find a port of this page here:
> 
> http://bombadil.infradead.org/~mcgrof/patches/ath9k/ath9k-fix-eeprom.patch.txt

(Thanks for the backport ;-)
-chris

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

end of thread, other threads:[~2009-04-21 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-14  1:41 [PATCH] atheros: fix propagation of bad EEPROM on regulatory init Luis R. Rodriguez
2009-04-21 19:40 ` [stable] " Chris Wright

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