Commit 71e5e886 authored by Johannes Berg's avatar Johannes Berg

cfg80211: regulatory: make initialization more robust

Since my change to split out the regulatory init to occur later,
any issues during earlier cfg80211_init() or errors during the
platform device allocation would lead to crashes later. Make this
more robust by checking that the earlier initialization succeeded.

Fixes: d7be102f ("cfg80211: initialize regulatory keys/database later")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent c70616bd
......@@ -3829,6 +3829,15 @@ static int __init regulatory_init_db(void)
{
int err;
/*
* It's possible that - due to other bugs/issues - cfg80211
* never called regulatory_init() below, or that it failed;
* in that case, don't try to do any further work here as
* it's doomed to lead to crashes.
*/
if (IS_ERR_OR_NULL(reg_pdev))
return -EINVAL;
err = load_builtin_regdb_keys();
if (err)
return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment