diff mbox

[bluetooth-next,2/2] ieee802154: 6lowpan: fix return of netdev notifier

Message ID 1452459025-13884-3-git-send-email-alex.aring@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Alexander Aring Jan. 10, 2016, 8:50 p.m. UTC
This patch fixed the return value of netdev notifier. If the command is
a don't care a NOTIFY_DONE should be returned. If the command matched a
NOTIFY_OK should be returned.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 net/ieee802154/6lowpan/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Stefan Schmidt Jan. 15, 2016, 2:39 p.m. UTC | #1
Hello.

On 10/01/16 21:50, Alexander Aring wrote:
> This patch fixed the return value of netdev notifier. If the command is
> a don't care a NOTIFY_DONE should be returned. If the command matched a
> NOTIFY_OK should be returned.
>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
>   net/ieee802154/6lowpan/core.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
> index 737c87a..0023c90 100644
> --- a/net/ieee802154/6lowpan/core.c
> +++ b/net/ieee802154/6lowpan/core.c
> @@ -207,7 +207,7 @@ static int lowpan_device_event(struct notifier_block *unused,
>   	struct net_device *wdev = netdev_notifier_info_to_dev(ptr);
>   
>   	if (wdev->type != ARPHRD_IEEE802154)
> -		goto out;
> +		return NOTIFY_DONE;
>   
>   	switch (event) {
>   	case NETDEV_UNREGISTER:
> @@ -219,11 +219,10 @@ static int lowpan_device_event(struct notifier_block *unused,
>   			lowpan_dellink(wdev->ieee802154_ptr->lowpan_dev, NULL);
>   		break;
>   	default:
> -		break;
> +		return NOTIFY_DONE;
>   	}
>   
> -out:
> -	return NOTIFY_DONE;
> +	return NOTIFY_OK;
>   }
>   
>   static struct notifier_block lowpan_dev_notifier = {

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>

regards
Stefan Schmidt

--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
index 737c87a..0023c90 100644
--- a/net/ieee802154/6lowpan/core.c
+++ b/net/ieee802154/6lowpan/core.c
@@ -207,7 +207,7 @@  static int lowpan_device_event(struct notifier_block *unused,
 	struct net_device *wdev = netdev_notifier_info_to_dev(ptr);
 
 	if (wdev->type != ARPHRD_IEEE802154)
-		goto out;
+		return NOTIFY_DONE;
 
 	switch (event) {
 	case NETDEV_UNREGISTER:
@@ -219,11 +219,10 @@  static int lowpan_device_event(struct notifier_block *unused,
 			lowpan_dellink(wdev->ieee802154_ptr->lowpan_dev, NULL);
 		break;
 	default:
-		break;
+		return NOTIFY_DONE;
 	}
 
-out:
-	return NOTIFY_DONE;
+	return NOTIFY_OK;
 }
 
 static struct notifier_block lowpan_dev_notifier = {