Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Feb 2009 11:09:27 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r189160 - in stable/7/sys: . cam contrib/pf dev/ath/ath_hal dev/cxgb
Message-ID:  <200902281109.n1SB9RJH007214@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902281109.n1SB9RJH007214>