From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: <johannes@sipsolutions.net>, <johannes@sipsolutions.net>,
<linville@tuxdriver.com>
Cc: "Luis R. Rodriguez" <lrodriguez@atheros.com>,
<linux-wireless@vger.kernel.org>, Greg KH <greg@kroah.com>
Subject: [PATCH v3 06/15] cfg80211: propagate -ENOMEM during regulatory_init()
Date: Tue, 17 Feb 2009 20:21:53 -0800 [thread overview]
Message-ID: <1234930922-29367-7-git-send-email-lrodriguez@atheros.com> (raw)
In-Reply-To: <1234930922-29367-1-git-send-email-lrodriguez@atheros.com>
Calling kobject_uevent_env() can fail mainly due to out of
memory conditions. We do not want to continue during such
conditions so propagate that as well instead of letting
cfg80211 load as if everything is peachy.
Additionally lets clarify that when CRDA is not called during
cfg80211's initialization _and_ if the error is not an -ENOMEM
its because kobject_uevent_env() failed to call CRDA, not because
CRDA failed. For those who want to find out why we also let you
do so by enabling the kernel config CONFIG_CFG80211_REG_DEBUG --
you'll get an actual stack trace.
So for now we'll treat non -ENOMEM kobject_uevent_env() failures as
non fatal during cfg80211's initialization.
CC: Greg KH <greg@kroah.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
net/wireless/reg.c | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 6373a78..47d5056 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1616,7 +1616,7 @@ void reg_device_remove(struct wiphy *wiphy)
int regulatory_init(void)
{
- int err;
+ int err = 0;
reg_pdev = platform_device_register_simple("regulatory", 0, NULL, 0);
if (IS_ERR(reg_pdev))
@@ -1637,12 +1637,24 @@ int regulatory_init(void)
cfg80211_regdomain = cfg80211_world_regdom;
err = regulatory_hint_core("00");
+#endif
if (err) {
- printk(KERN_ERR "cfg80211: calling CRDA failed - "
- "unable to update world regulatory domain, "
- "using static definition\n");
- }
+ if (err == -ENOMEM)
+ return err;
+ /*
+ * N.B. kobject_uevent_env() can fail mainly for when we're out
+ * memory which is handled and propagated appropriately above
+ * but it can also fail during a netlink_broadcast() or during
+ * early boot for call_usermodehelper(). For now treat these
+ * errors as non-fatal.
+ */
+ printk(KERN_ERR "cfg80211: kobject_uevent_env() was unable "
+ "to call CRDA during init");
+#ifdef CONFIG_CFG80211_REG_DEBUG
+ /* We want to find out exactly why when debugging */
+ WARN_ON(err);
#endif
+ }
return 0;
}
--
1.6.1.2.253.ga34a
next prev parent reply other threads:[~2009-02-18 4:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-18 4:21 [PATCH v3 00/15] cfg80211: add a workqueue for regulatory processing Luis R. Rodriguez
2009-02-18 4:21 ` [PATCH v3 04/15] nl80211: disallow user requests prior to regulatory_init() Luis R. Rodriguez
2009-02-18 4:21 ` [PATCH v3 05/15] cfg80211: add regulatory_hint_core() to separate the core reg hint Luis R. Rodriguez
2009-02-18 4:21 ` Luis R. Rodriguez [this message]
2009-02-18 4:21 ` [PATCH v3 10/15] cfg80211: remove likely from an 11d hint case Luis R. Rodriguez
2009-02-18 4:22 ` [PATCH v3 14/15] cfg80211: allow drivers that agree on regulatory to agree Luis R. Rodriguez
[not found] ` <20090218221824.GB3953@tuxdriver.com>
2009-02-18 22:20 ` [PATCH v3 00/15] cfg80211: add a workqueue for regulatory processing Luis R. Rodriguez
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=1234930922-29367-7-git-send-email-lrodriguez@atheros.com \
--to=lrodriguez@atheros.com \
--cc=greg@kroah.com \
--cc=johannes@sipsolutions.net \
--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).