linux-stable/net/wireless
Chen Zhongjin 46dfff9102 wifi: cfg80211: Fix not unregister reg_pdev when load_builtin_regdb_keys() fails
[ Upstream commit 833a9fd28c ]

In regulatory_init_db(), when it's going to return a error, reg_pdev
should be unregistered. When load_builtin_regdb_keys() fails it doesn't
do it and makes cfg80211 can't be reload with report:

sysfs: cannot create duplicate filename '/devices/platform/regulatory.0'
 ...
 <TASK>
 dump_stack_lvl+0x79/0x9b
 sysfs_warn_dup.cold+0x1c/0x29
 sysfs_create_dir_ns+0x22d/0x290
 kobject_add_internal+0x247/0x800
 kobject_add+0x135/0x1b0
 device_add+0x389/0x1be0
 platform_device_add+0x28f/0x790
 platform_device_register_full+0x376/0x4b0
 regulatory_init+0x9a/0x4b2 [cfg80211]
 cfg80211_init+0x84/0x113 [cfg80211]
 ...

Fixes: 90a53e4432 ("cfg80211: implement regdb signature checking")
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Link: https://lore.kernel.org/r/20221109090237.214127-1-chenzhongjin@huawei.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-18 11:41:08 +01:00
..
certs
.gitignore
ap.c
chan.c
core.c cfg80211: set custom regdomain after wiphy registration 2022-06-06 08:33:50 +02:00
core.h nl80211: validate key indexes for cfg80211_registered_device 2021-06-10 13:37:02 +02:00
debugfs.c wifi: cfg80211: debugfs: fix return type in ht40allow_map_read() 2022-09-15 12:04:50 +02:00
debugfs.h
ethtool.c cfg80211: check wiphy driver existence for drvinfo report 2020-03-05 16:43:36 +01:00
ibss.c
Kconfig lib80211: fix unmet direct dependendices config warning when !CRYPTO 2020-10-01 13:18:20 +02:00
lib80211.c
lib80211_crypt_ccmp.c
lib80211_crypt_tkip.c
lib80211_crypt_wep.c
Makefile cfg80211: make certificate generation more robust 2021-06-23 14:41:29 +02:00
mesh.c
mlme.c
nl80211.c nl80211: show SSID for P2P_GO interfaces 2022-06-14 18:11:32 +02:00
nl80211.h
ocb.c
of.c
pmsr.c cfg80211: avoid double free of PMSR request 2021-06-23 14:41:30 +02:00
radiotap.c
rdev-ops.h cfg80211: Fix radar event during another phy CAC 2020-02-05 21:22:46 +00:00
reg.c wifi: cfg80211: Fix not unregister reg_pdev when load_builtin_regdb_keys() fails 2023-01-18 11:41:08 +01:00
reg.h
scan.c wifi: cfg80211: fix buffer overflow in elem comparison 2022-12-08 11:23:03 +01:00
sme.c cfg80211: remove WARN_ON() in cfg80211_sme_connect 2021-04-14 08:24:18 +02:00
sysfs.c
sysfs.h
trace.c
trace.h cfg80211: Fix radar event during another phy CAC 2020-02-05 21:22:46 +00:00
util.c cfg80211: call cfg80211_stop_ap when switch from P2P_GO type 2021-11-26 10:47:22 +01:00
wext-compat.c
wext-compat.h
wext-core.c wext: fix NULL-ptr-dereference with cfg80211's lack of commit() 2021-02-03 23:25:56 +01:00
wext-priv.c
wext-proc.c
wext-sme.c
wext-spy.c wireless: wext-spy: Fix out-of-bounds warning 2021-07-19 08:53:12 +02:00