From owner-freebsd-current Mon Sep 30 11:39:40 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82D8937B401 for ; Mon, 30 Sep 2002 11:39:38 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id BB43C43E42 for ; Mon, 30 Sep 2002 11:39:32 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 82751 invoked by uid 1000); 30 Sep 2002 18:39:33 -0000 Date: Mon, 30 Sep 2002 11:39:33 -0700 (PDT) From: Nate Lawson To: Poul-Henning Kamp Cc: audit@freebsd.org, current@freebsd.org Subject: Re: PATCH: various memory leaks. In-Reply-To: <59914.1033370423@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 30 Sep 2002, Poul-Henning Kamp wrote: > > I went through the FlexeLint output of the LINT kernel on i386 and > tried to examine all warnings about memoryleaks in central or > semi-central code. > > I this patch I belive addresses the ones I think I could confirm, > in the following files: > cam/scsi/scsi_cd.c > cam/scsi/scsi_da.c > dev/ata/ata-all.c > fs/pseudofs/pseudofs_vncache.c > fs/umapfs/umap_vfsops.c > kern/kern_ktrace.c > kern/kern_linker.c > ufs/ufs/ufs_vnops.c > > I would appreciate if the respective owners, authors, maintainers > etc would review and commit their own bits from this patch. > > Thanks in advance! > > Poul-Henning > > > Index: cam/scsi/scsi_cd.c > =================================================================== > RCS file: /home/ncvs/src/sys/cam/scsi/scsi_cd.c,v > retrieving revision 1.61 > diff -u -r1.61 scsi_cd.c > --- cam/scsi/scsi_cd.c 28 Sep 2002 17:14:05 -0000 1.61 > +++ cam/scsi/scsi_cd.c 30 Sep 2002 06:11:54 -0000 > @@ -1463,6 +1463,7 @@ > start_ccb->ccb_h.ccb_bp = NULL; > start_ccb->ccb_h.ccb_state = CD_CCB_PROBE; > xpt_action(start_ccb); > + /* XXX missing free(rcap, M_TEMP) ??? */ > break; > } > } > Index: cam/scsi/scsi_da.c > =================================================================== > RCS file: /home/ncvs/src/sys/cam/scsi/scsi_da.c,v > retrieving revision 1.108 > diff -u -r1.108 scsi_da.c > --- cam/scsi/scsi_da.c 20 Sep 2002 19:35:52 -0000 1.108 > +++ cam/scsi/scsi_da.c 30 Sep 2002 06:13:35 -0000 > @@ -1249,6 +1249,7 @@ > start_ccb->ccb_h.ccb_bp = NULL; > start_ccb->ccb_h.ccb_state = DA_CCB_PROBE; > xpt_action(start_ccb); > + /* XXX missing free(rcap, M_TEMP) ?? */ > break; > } > } Thanks for working on cleaning things up. The SCSI ones are wrong. The rcap is attached to csio->data_ptr and is unconditionally freed in the completion routine, cddone() (see the CD_CCB_PROBE case there). -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message