Author: adrian
Date: Sat Jun 29 16:49:00 2013
New Revision: 252381
URL: http://svnweb.freebsd.org/changeset/base/252381

Log:
  Check the return value from ath_hal_malloc()
  
  Reported by:  uqs

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
==============================================================================
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c     Sat Jun 29 
16:45:37 2013        (r252380)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c     Sat Jun 29 
16:49:00 2013        (r252381)
@@ -639,6 +639,11 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC
 
     /* 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.
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to