]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cfg80211: fix wiphy_register error path
authorJohannes Berg <johannes.berg@intel.com>
Fri, 10 May 2013 17:23:40 +0000 (19:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Jun 2013 19:52:23 +0000 (12:52 -0700)
commitc183f01b8c909323c42c77304f2fc4ad68cbd4a8
treebc6f3e47a23bdf6fa0530bf5f749f5dc97f50901
parentb380790737a4c11e034ddeb56832b2cac35af6f0
cfg80211: fix wiphy_register error path

commit 03cd7e4e1ea16cd151c799a33b5ca1fd41a464df upstream.

If rfkill_register() fails in wiphy_register() the struct device
is unregistered but everything else isn't (regulatory, debugfs)
and we even leave the wiphy instance on all internal lists even
though it will likely be freed soon, which is clearly a problem.
Fix this by cleaning up properly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/core.c