Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/isc/atheros_hal/dist Protect against a NULL poi...
details: https://anonhg.NetBSD.org/src/rev/d8f14fb86605
branches: trunk
changeset: 761384:d8f14fb86605
user: dyoung <dyoung%NetBSD.org@localhost>
date: Wed Jan 26 00:55:42 2011 +0000
description:
Protect against a NULL pointer dereference that I've seen in the wild.
diffstat:
sys/external/isc/atheros_hal/dist/ah_internal.h | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (26 lines):
diff -r a58ee507e807 -r d8f14fb86605 sys/external/isc/atheros_hal/dist/ah_internal.h
--- a/sys/external/isc/atheros_hal/dist/ah_internal.h Wed Jan 26 00:54:35 2011 +0000
+++ b/sys/external/isc/atheros_hal/dist/ah_internal.h Wed Jan 26 00:55:42 2011 +0000
@@ -14,7 +14,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: ah_internal.h,v 1.3 2009/05/14 09:07:49 reinoud Exp $
+ * $Id: ah_internal.h,v 1.4 2011/01/26 00:55:42 dyoung Exp $
*/
#ifndef _ATH_AH_INTERAL_H_
#define _ATH_AH_INTERAL_H_
@@ -324,8 +324,11 @@
#define ath_hal_getNoiseFloor(_ah, _nfArray) \
AH_PRIVATE(_ah)->ah_getNoiseFloor(_ah, _nfArray)
-#define ath_hal_eepromDetach(_ah) \
- AH_PRIVATE(_ah)->ah_eepromDetach(_ah)
+#define ath_hal_eepromDetach(_ah) \
+do { \
+ if (AH_PRIVATE(_ah)->ah_eepromDetach != NULL) \
+ AH_PRIVATE(_ah)->ah_eepromDetach(_ah); \
+} while (/*CONSTCOND*/0)
#define ath_hal_eepromGet(_ah, _param, _val) \
AH_PRIVATE(_ah)->ah_eepromGet(_ah, _param, _val)
#define ath_hal_eepromSet(_ah, _param, _val) \
Home |
Main Index |
Thread Index |
Old Index