From 903dfcfc442f27af7f14d98a10818ea4188cd3ba Mon Sep 17 00:00:00 2001 From: adrian Date: Sat, 29 Jun 2013 16:49:00 +0000 Subject: Check the return value from ath_hal_malloc() Reported by: uqs --- sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/contrib/dev/ath/ath_hal/ar9300') 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. -- cgit v1.1