From: Alexander Aring Date: Thu, 30 Apr 2015 15:44:53 +0000 (+0200) Subject: mac802154: fix ieee802154_register_hw error handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b4d413c3871af0f2ccd466fb6581ed2c2d89438;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Marcel Holtmann --- 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: