diff options
author | Andrey Borzenkov <arvidjaar@mail.ru> | 2009-02-15 04:51:18 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-23 13:17:51 -0500 |
commit | 5c138dcee7d4a9e68cce546a45968bbf5dbfce80 (patch) | |
tree | c0ce0923c60ee3d4b4a83e5c919564634a0c3555 | |
parent | 486a87f1e5624096bd1c09e9e716239597d48dca (diff) |
orinoco: do not resgister NULL pm_notifier function
With DEBUG_NOTIFIERS it results in
[11330.890966] WARNING: at /home/bor/src/linux-git/kernel/notifier.c:88
notifier_call_chain+0x91/0xa0()
[11330.890977] Hardware name: PORTEGE 4000
[11330.890983] Invalid notifier called! ...
Without DEBUG_NOTIFIERS it most likely crashes on NULL pointer.
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Acked-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/net/wireless/orinoco/orinoco.c b/drivers/net/wireless/orinoco/orinoco.c index 45a04faa7818..067d1a9c728b 100644 --- a/drivers/net/wireless/orinoco/orinoco.c +++ b/drivers/net/wireless/orinoco/orinoco.c | |||
@@ -3157,8 +3157,20 @@ static int orinoco_pm_notifier(struct notifier_block *notifier, | |||
3157 | 3157 | ||
3158 | return NOTIFY_DONE; | 3158 | return NOTIFY_DONE; |
3159 | } | 3159 | } |
3160 | |||
3161 | static void orinoco_register_pm_notifier(struct orinoco_private *priv) | ||
3162 | { | ||
3163 | priv->pm_notifier.notifier_call = orinoco_pm_notifier; | ||
3164 | register_pm_notifier(&priv->pm_notifier); | ||
3165 | } | ||
3166 | |||
3167 | static void orinoco_unregister_pm_notifier(struct orinoco_private *priv) | ||
3168 | { | ||
3169 | unregister_pm_notifier(&priv->pm_notifier); | ||
3170 | } | ||
3160 | #else /* !PM_SLEEP || HERMES_CACHE_FW_ON_INIT */ | 3171 | #else /* !PM_SLEEP || HERMES_CACHE_FW_ON_INIT */ |
3161 | #define orinoco_pm_notifier NULL | 3172 | #define orinoco_register_pm_notifier(priv) do { } while(0) |
3173 | #define orinoco_unregister_pm_notifier(priv) do { } while(0) | ||
3162 | #endif | 3174 | #endif |
3163 | 3175 | ||
3164 | /********************************************************************/ | 3176 | /********************************************************************/ |
@@ -3648,8 +3660,7 @@ struct net_device | |||
3648 | priv->cached_fw = NULL; | 3660 | priv->cached_fw = NULL; |
3649 | 3661 | ||
3650 | /* Register PM notifiers */ | 3662 | /* Register PM notifiers */ |
3651 | priv->pm_notifier.notifier_call = orinoco_pm_notifier; | 3663 | orinoco_register_pm_notifier(priv); |
3652 | register_pm_notifier(&priv->pm_notifier); | ||
3653 | 3664 | ||
3654 | return dev; | 3665 | return dev; |
3655 | } | 3666 | } |
@@ -3673,7 +3684,7 @@ void free_orinocodev(struct net_device *dev) | |||
3673 | kfree(rx_data); | 3684 | kfree(rx_data); |
3674 | } | 3685 | } |
3675 | 3686 | ||
3676 | unregister_pm_notifier(&priv->pm_notifier); | 3687 | orinoco_unregister_pm_notifier(priv); |
3677 | orinoco_uncache_fw(priv); | 3688 | orinoco_uncache_fw(priv); |
3678 | 3689 | ||
3679 | priv->wpa_ie_len = 0; | 3690 | priv->wpa_ie_len = 0; |