svn commit: r187651 - head/sys/cam/scsi
Edward Tomasz Napierala
trasz at FreeBSD.org
Fri Jan 23 13:06:17 PST 2009
Author: trasz
Date: Fri Jan 23 21:06:16 2009
New Revision: 187651
URL: http://svn.freebsd.org/changeset/base/187651
Log:
Don't leak memory when alloc fails.
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Found with: Coverity Prevent(tm)
CID: 2908
Modified:
head/sys/cam/scsi/scsi_low.c
Modified: head/sys/cam/scsi/scsi_low.c
==============================================================================
--- head/sys/cam/scsi/scsi_low.c Fri Jan 23 21:05:16 2009 (r187650)
+++ head/sys/cam/scsi/scsi_low.c Fri Jan 23 21:06:16 2009 (r187651)
@@ -966,16 +966,16 @@ scsi_low_rescan_bus_cam(slp)
struct scsi_low_softc *slp;
{
struct cam_path *path;
- union ccb *ccb = xpt_alloc_ccb();
+ union ccb *ccb;
cam_status status;
- bzero(ccb, sizeof(union ccb));
-
status = xpt_create_path(&path, xpt_periph,
cam_sim_path(slp->sl_si.sim), -1, 0);
if (status != CAM_REQ_CMP)
return;
+ ccb = xpt_alloc_ccb();
+ bzero(ccb, sizeof(union ccb));
xpt_setup_ccb(&ccb->ccb_h, path, 5);
ccb->ccb_h.func_code = XPT_SCAN_BUS;
ccb->ccb_h.cbfcnp = scsi_low_cam_rescan_callback;
More information about the svn-src-all
mailing list