]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
wifi: cfg80211: Fix not unregister reg_pdev when load_builtin_regdb_keys() fails
authorChen Zhongjin <chenzhongjin@huawei.com>
Wed, 9 Nov 2022 09:02:37 +0000 (17:02 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 1 Dec 2022 14:09:10 +0000 (15:09 +0100)
commit833a9fd28c9b7ccb39a334721379e992dc1c0c89
tree2d6efa8cefe9b6bdf496caba1bb994c084fc28f2
parentc1d3214d61d93eb4a3959c6b402230988d0f362d
wifi: cfg80211: Fix not unregister reg_pdev when load_builtin_regdb_keys() fails

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: 90a53e4432b1 ("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>
net/wireless/reg.c