mirror of
https://github.com/torvalds/linux
synced 2024-10-23 11:46:42 +00:00
wl1271: fix the inetdev notifier callback return values
The wl1271_dev_notify() was returning 0 or -ENODEV, when it should return NOTIFY_* instead. Now we use NOTIFY_DONE when we didn't handle the event or NOTIFY_OK when we have handled it. For inetdev notifications, it doesn't matter whether we use NOTIFY_DONE or NOTIFY_OK, because it ignores the return value of the call to blocking_notifier_call_chain(). But the notify.h header says that NOTIFY_DONE is "Don't care" and NOTIFY_OK is "Suits me", so that seems to be the right way to do it. Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
03442a3317
commit
17d7265c75
|
@ -815,15 +815,15 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
|
|||
|
||||
wdev = dev->ieee80211_ptr;
|
||||
if (wdev == NULL)
|
||||
return -ENODEV;
|
||||
return NOTIFY_DONE;
|
||||
|
||||
wiphy = wdev->wiphy;
|
||||
if (wiphy == NULL)
|
||||
return -ENODEV;
|
||||
return NOTIFY_DONE;
|
||||
|
||||
hw = wiphy_priv(wiphy);
|
||||
if (hw == NULL)
|
||||
return -ENODEV;
|
||||
return NOTIFY_DONE;
|
||||
|
||||
/* Check that the interface is one supported by this driver. */
|
||||
wl_temp = hw->priv;
|
||||
|
@ -832,7 +832,7 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
|
|||
break;
|
||||
}
|
||||
if (wl == NULL)
|
||||
return -ENODEV;
|
||||
return NOTIFY_DONE;
|
||||
|
||||
/* Get the interface IP address for the device. "ifa" will become
|
||||
NULL if:
|
||||
|
@ -868,7 +868,7 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
|
|||
out:
|
||||
mutex_unlock(&wl->mutex);
|
||||
|
||||
return ret;
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static struct notifier_block wl1271_dev_notifier = {
|
||||
|
|
Loading…
Reference in a new issue