summaryrefslogtreecommitdiff
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-04-30 18:44:53 +0300
committerMarcel Holtmann <marcel@holtmann.org>2015-04-30 19:46:21 +0300
commit2b4d413c3871af0f2ccd466fb6581ed2c2d89438 (patch)
treeb771b12b196f1e9cc75524fb7e27b36d91901d3e /net/mac802154
parentd24d81444f8caf1895256ef2d2e89ae8202a17e4 (diff)
downloadlinux-2b4d413c3871af0f2ccd466fb6581ed2c2d89438.tar.xz
mac802154: fix ieee802154_register_hw error handling
Currently if ieee802154_if_add failed, we don't unregister the wpan phy which was registered before. This patch adds a correct error handling for unregister the wpan phy when ieee802154_if_add failed. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac802154/main.c b/net/mac802154/main.c
index 8500378c8318..beece7b7a776 100644
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -166,13 +166,15 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
if (IS_ERR(dev)) {
rtnl_unlock();
rc = PTR_ERR(dev);
- goto out_wq;
+ goto out_phy;
}
rtnl_unlock();
return 0;
+out_phy:
+ wpan_phy_unregister(local->phy);
out_wq:
destroy_workqueue(local->workqueue);
out: