Skip to content

Commit

Permalink
mac802154: fix ieee802154_register_hw error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Aring authored and Marcel Holtmann committed Apr 30, 2015
1 parent d24d814 commit 2b4d413
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/mac802154/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2b4d413

Please sign in to comment.