Check the return value from ath_hal_malloc()

Reported by:	uqs
This commit is contained in:
Adrian Chadd 2013-06-29 16:49:00 +00:00
parent f82ca5238a
commit 8978a6a9da

View File

@ -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.