Date: Wed, 29 Apr 2015 15:46:57 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282227 - head/sys/cam/scsi Message-ID: <201504291546.t3TFkwwU073637@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Wed Apr 29 15:46:57 2015 New Revision: 282227 URL: https://svnweb.freebsd.org/changeset/base/282227 Log: Fix memory leak in scsi_scan_bus() CID: 1007770 PR: 199671 Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Wed Apr 29 15:41:19 2015 (r282226) +++ head/sys/cam/scsi/scsi_xpt.c Wed Apr 29 15:46:57 2015 (r282227) @@ -2008,6 +2008,7 @@ scsi_scan_bus(struct cam_periph *periph, " with status %#x, bus scan halted\n", status); free(scan_info, M_CAMXPT); + scan_info = NULL; request_ccb->ccb_h.status = status; xpt_free_ccb(work_ccb); xpt_done(request_ccb); @@ -2017,6 +2018,7 @@ scsi_scan_bus(struct cam_periph *periph, if (work_ccb == NULL) { xpt_free_ccb((union ccb *)scan_info->cpi); free(scan_info, M_CAMXPT); + scan_info = NULL; xpt_free_path(path); request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(request_ccb); @@ -2032,6 +2034,7 @@ scsi_scan_bus(struct cam_periph *periph, xpt_action(work_ccb); } + free(scan_info, M_CAMXPT); mtx_lock(mtx); break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504291546.t3TFkwwU073637>