svn commit: r210210 - stable/8/sys/cam/ata

Alexander Motin mav at FreeBSD.org
Sun Jul 18 07:31:25 UTC 2010


Author: mav
Date: Sun Jul 18 07:31:25 2010
New Revision: 210210
URL: http://svn.freebsd.org/changeset/base/210210

Log:
  MFC r208823:
  Add allocation error handling.

Modified:
  stable/8/sys/cam/ata/ata_xpt.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/cam/ata/ata_xpt.c
==============================================================================
--- stable/8/sys/cam/ata/ata_xpt.c	Sun Jul 18 07:29:37 2010	(r210209)
+++ stable/8/sys/cam/ata/ata_xpt.c	Sun Jul 18 07:31:25 2010	(r210210)
@@ -1209,6 +1209,12 @@ ata_scan_bus(struct cam_periph *periph, 
 		    !(work_ccb->cpi.hba_misc & PIM_NOBUSRESET) &&
 		    !timevalisset(&request_ccb->ccb_h.path->bus->last_reset)) {
 			reset_ccb = xpt_alloc_ccb_nowait();
+			if (reset_ccb == NULL) {
+				request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+				xpt_free_ccb(work_ccb);
+				xpt_done(request_ccb);
+				return;
+			}
 			xpt_setup_ccb(&reset_ccb->ccb_h, request_ccb->ccb_h.path,
 			      CAM_PRIORITY_NONE);
 			reset_ccb->ccb_h.func_code = XPT_RESET_BUS;
@@ -1228,6 +1234,7 @@ ata_scan_bus(struct cam_periph *periph, 
 		    malloc(sizeof(ata_scan_bus_info), M_CAMXPT, M_NOWAIT);
 		if (scan_info == NULL) {
 			request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+			xpt_free_ccb(work_ccb);
 			xpt_done(request_ccb);
 			return;
 		}


More information about the svn-src-all mailing list