svn commit: r189160 - in stable/7/sys: . cam contrib/pf
dev/ath/ath_hal dev/cxgb
Edward Tomasz Napierala
trasz at FreeBSD.org
Sat Feb 28 03:09:30 PST 2009
Author: trasz
Date: Sat Feb 28 11:09:27 2009
New Revision: 189160
URL: http://svn.freebsd.org/changeset/base/189160
Log:
MFC r187652:
Protect against NULL pointer dereference.
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Modified:
stable/7/sys/ (props changed)
stable/7/sys/cam/cam_xpt.c
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/dev/ath/ath_hal/ (props changed)
stable/7/sys/dev/cxgb/ (props changed)
Modified: stable/7/sys/cam/cam_xpt.c
==============================================================================
--- stable/7/sys/cam/cam_xpt.c Sat Feb 28 11:03:24 2009 (r189159)
+++ stable/7/sys/cam/cam_xpt.c Sat Feb 28 11:09:27 2009 (r189160)
@@ -5194,6 +5194,11 @@ xpt_scan_bus(struct cam_periph *periph,
/* Save some state for use while we probe for devices */
scan_info = (xpt_scan_bus_info *)
malloc(sizeof(xpt_scan_bus_info), M_CAMXPT, M_NOWAIT);
+ if (scan_info == NULL) {
+ request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+ xpt_done(request_ccb);
+ return;
+ }
scan_info->request_ccb = request_ccb;
scan_info->cpi = &work_ccb->cpi;
More information about the svn-src-stable-7
mailing list