提交 5247a77c 编写于 作者: H Haim Dreyfuss 提交者: Johannes Berg

cfg80211: fix NULL pointer derference when querying regdb

Some drivers may call this function when regdb is not initialized yet,
so we need to make sure regdb is valid before trying to access it.

Make sure regdb is initialized before trying to access it in
reg_query_regdb_wmm() and query_regdb().
Reported-by: NEric Biggers <ebiggers3@gmail.com>
Signed-off-by: NHaim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 1d6741d8
...@@ -916,6 +916,9 @@ int reg_query_regdb_wmm(char *alpha2, int freq, u32 *dbptr, ...@@ -916,6 +916,9 @@ int reg_query_regdb_wmm(char *alpha2, int freq, u32 *dbptr,
const struct fwdb_header *hdr = regdb; const struct fwdb_header *hdr = regdb;
const struct fwdb_country *country; const struct fwdb_country *country;
if (!regdb)
return -ENODATA;
if (IS_ERR(regdb)) if (IS_ERR(regdb))
return PTR_ERR(regdb); return PTR_ERR(regdb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册