Make ath_hal_eepromDetach() safer

Check that AH_PRIVATE(_ah)->ah_eepromDetach is not NULL before calling
it.  This fixes kernel oops in case if the attach function for the chip
fails before EEPROM support initialization and calls the corresponding
detach function.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3991 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
proski 2009-04-08 22:25:50 +00:00
parent 519d1b2a2e
commit ec2664e900
1 changed files with 4 additions and 2 deletions

View File

@ -319,8 +319,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_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) \