net: wireless: bcm4329: Fix unregister_early_suspend() in dhd_detach()
authorDmitry Shmidt <dimitrysh@google.com>
Tue, 10 Aug 2010 22:20:35 +0000 (15:20 -0700)
committerColin Cross <ccross@android.com>
Thu, 30 Sep 2010 00:49:43 +0000 (17:49 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcm4329/dhd_linux.c

index 01a9d768a05498e0432e818b2615da7937709ff0..45329e9a8b2caeebf71d3a680584f6ddee8ad8fd 100644 (file)
@@ -2369,7 +2369,8 @@ dhd_detach(dhd_pub_t *dhdp)
                        int i;
 
 #if defined(CONFIG_HAS_EARLYSUSPEND)
-                       unregister_early_suspend(&dhd->early_suspend);
+                       if (dhd->early_suspend.suspend)
+                               unregister_early_suspend(&dhd->early_suspend);
 #endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
 #if defined(CONFIG_WIRELESS_EXT)
                        /* Attach and link in the iw */