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>
This commit is contained in:
Alexander Aring 2015-04-30 17:44:53 +02:00 коммит произвёл Marcel Holtmann
Родитель d24d81444f
Коммит 2b4d413c38
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -166,13 +166,15 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
if (IS_ERR(dev)) { if (IS_ERR(dev)) {
rtnl_unlock(); rtnl_unlock();
rc = PTR_ERR(dev); rc = PTR_ERR(dev);
goto out_wq; goto out_phy;
} }
rtnl_unlock(); rtnl_unlock();
return 0; return 0;
out_phy:
wpan_phy_unregister(local->phy);
out_wq: out_wq:
destroy_workqueue(local->workqueue); destroy_workqueue(local->workqueue);
out: out: