Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2002 11:39:33 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Poul-Henning Kamp <phk@freebsd.org>
Cc:        audit@freebsd.org, current@freebsd.org
Subject:   Re: PATCH: various memory leaks.
Message-ID:  <Pine.BSF.4.21.0209301136460.82749-100000@root.org>
In-Reply-To: <59914.1033370423@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0209301136460.82749-100000>