Author: sam
Date: Thu Apr  9 16:53:59 2009
New Revision: 190867
URL: http://svn.freebsd.org/changeset/base/190867
Log:
  check the method pointer before invoking ah_eepromDetach as it can
  be null if attach work fails before hooking up the eeprom support
  
  Obtained from:        madwifi

Modified:
  head/sys/dev/ath/ath_hal/ah_internal.h

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_internal.h      Thu Apr  9 13:02:55 2009        
(r190866)
+++ head/sys/dev/ath/ath_hal/ah_internal.h      Thu Apr  9 16:53:59 2009        
(r190867)
@@ -333,8 +333,10 @@ struct ath_hal_private {
 #define        ath_hal_disablePCIE(_ah) \
        (_ah)->ah_disablePCIE(_ah)
 
-#define        ath_hal_eepromDetach(_ah) \
-       AH_PRIVATE(_ah)->ah_eepromDetach(_ah)
+#define        ath_hal_eepromDetach(_ah) do {                          \
+       if (AH_PRIVATE(_ah)->ah_eepromDetach != AH_NULL)        \
+               AH_PRIVATE(_ah)->ah_eepromDetach(_ah);          \
+} while (0)
 #define        ath_hal_eepromGet(_ah, _param, _val) \
        AH_PRIVATE(_ah)->ah_eepromGet(_ah, _param, _val)
 #define        ath_hal_eepromSet(_ah, _param, _val) \
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to