svn commit: r260996 - head/sys/cam

Alexander Motin mav at FreeBSD.org
Tue Jan 21 23:15:24 UTC 2014


Author: mav
Date: Tue Jan 21 23:15:23 2014
New Revision: 260996
URL: http://svnweb.freebsd.org/changeset/base/260996

Log:
  Fix memory and references leak due to unfreed path in case we can't
  allocate bus scan CCB.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Tue Jan 21 21:30:44 2014	(r260995)
+++ head/sys/cam/cam_xpt.c	Tue Jan 21 23:15:23 2014	(r260996)
@@ -3919,9 +3919,11 @@ xpt_bus_register(struct cam_sim *sim, de
 				scan_ccb->ccb_h.func_code = XPT_SCAN_BUS;
 				scan_ccb->crcn.flags = 0;
 				xpt_rescan(scan_ccb);
-			} else
+			} else {
 				xpt_print(path,
 					  "Can't allocate CCB to scan bus\n");
+				xpt_free_path(path);
+			}
 		} else
 			xpt_free_path(path);
 	} else


More information about the svn-src-all mailing list