Skip to content

Commit 2b4d413

Browse files
alexaringholtmann
authored andcommitted
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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent d24d814 commit 2b4d413

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/mac802154/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,15 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
166166
if (IS_ERR(dev)) {
167167
rtnl_unlock();
168168
rc = PTR_ERR(dev);
169-
goto out_wq;
169+
goto out_phy;
170170
}
171171

172172
rtnl_unlock();
173173

174174
return 0;
175175

176+
out_phy:
177+
wpan_phy_unregister(local->phy);
176178
out_wq:
177179
destroy_workqueue(local->workqueue);
178180
out:

0 commit comments

Comments
 (0)