PERFORCE change 164329 for review

Alexander Motin mav at FreeBSD.org
Sun Jun 14 12:02:29 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=164329

Change 164329 by mav at mav_mavbook on 2009/06/14 12:01:41

	Plug paths leak on bus scan.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#20 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#20 (text+ko) ====

@@ -1213,13 +1213,12 @@
 		work_ccb = request_ccb;
 		/* Reuse the same CCB to query if a device was really found */
 		scan_info = (ata_scan_bus_info *)work_ccb->ccb_h.ppriv_ptr0;
-
-		/*
-		 * Free the current request path- we're done with it.
-		 */
+		/* Free the current request path- we're done with it. */
 		xpt_free_path(work_ccb->ccb_h.path);
+		/* If there is PM... */
 		if (scan_info->counter == 15 &&
 		    work_ccb->ccb_h.ppriv_field1 != 0) {
+			/* Save PM probe result. */
 			scan_info->found = work_ccb->ccb_h.ppriv_field1;
 			/* Report SIM that PM is present. */
 			bzero(&cts, sizeof(cts));
@@ -1260,6 +1259,7 @@
 		}
 		if ((scan_info->found & (1 << scan_info->counter)) == 0) {
 			xpt_async(AC_LOST_DEVICE, path, NULL);
+			xpt_free_path(path);
 			goto take_next;
 		}
 		xpt_setup_ccb(&work_ccb->ccb_h, path,


More information about the p4-projects mailing list