Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
* [PATCH bluetooth-next] mac802154: fix ieee802154_register_hw error handling
@ 2015-04-13  9:08 Alexander Aring
  2015-04-13  9:25 ` Varka Bhadram
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Aring @ 2015-04-13  9:08 UTC (permalink / raw)
  To: linux-wpan; +Cc: kernel, Alexander Aring

Currently if ieee802154_if_add failed, we don't unregister the wpan phy
which was registrated 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>
---
 net/mac802154/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mac802154/main.c b/net/mac802154/main.c
index 8500378..beece7b 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:
-- 
2.3.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH bluetooth-next] mac802154: fix ieee802154_register_hw error handling
  2015-04-13  9:08 [PATCH bluetooth-next] mac802154: fix ieee802154_register_hw error handling Alexander Aring
@ 2015-04-13  9:25 ` Varka Bhadram
  0 siblings, 0 replies; 2+ messages in thread
From: Varka Bhadram @ 2015-04-13  9:25 UTC (permalink / raw)
  To: Alexander Aring, linux-wpan; +Cc: kernel

On 04/13/2015 02:38 PM, Alexander Aring wrote:

> Currently if ieee802154_if_add failed, we don't unregister the wpan phy
> which was registrated before. This patch adds a correct error handling

s/registrated/registered

> for unregister the wpan phy when ieee802154_if_add failed.
>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
>  net/mac802154/main.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/mac802154/main.c b/net/mac802154/main.c
> index 8500378..beece7b 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:

--
Thanks,
Varka Bhadram.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-13  9:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-13  9:08 [PATCH bluetooth-next] mac802154: fix ieee802154_register_hw error handling Alexander Aring
2015-04-13  9:25 ` Varka Bhadram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox