summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-06-29 16:49:00 +0000
committeradrian <adrian@FreeBSD.org>2013-06-29 16:49:00 +0000
commit903dfcfc442f27af7f14d98a10818ea4188cd3ba (patch)
tree9c157b0353caff158cb5ca35e734280ab9bf07ef
parent8bf5f6d72deb319ed6e779603ae1de444417e17d (diff)
downloadFreeBSD-src-903dfcfc442f27af7f14d98a10818ea4188cd3ba.zip
FreeBSD-src-903dfcfc442f27af7f14d98a10818ea4188cd3ba.tar.gz
Check the return value from ath_hal_malloc()
Reported by: uqs
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
index 5142115..335414e 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
@@ -639,6 +639,11 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
/* FreeBSD: to make OTP work for now, provide this.. */
AH9300(ah)->ah_cal_mem = ath_hal_malloc(HOST_CALDATA_SIZE);
+ if (AH9300(ah)->ah_cal_mem == NULL) {
+ ath_hal_printf(ah, "%s: caldata malloc failed!\n", __func__);
+ ecode = HAL_EIO;
+ goto bad;
+ }
/*
* If eepromdata is not NULL, copy it it into ah_cal_mem.
OpenPOWER on IntegriCloud