Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jun 2012 11:06:41 -0600
From:      "Kenneth D. Merry" <ken@FreeBSD.org>
To:        "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Cc:        "freebsd-scsi@freebsd.org" <freebsd-scsi@FreeBSD.org>, "freebsd-fs@freebsd.org" <freebsd-fs@FreeBSD.org>, "McConnell, Stephen" <Stephen.McConnell@lsi.com>, "Reddy, Sreekanth" <Sreekanth.Reddy@lsi.com>
Subject:   Re: Kernel panic in FreeBSD-8.3 from UFS
Message-ID:  <20120606170640.GA98428@nargothrond.kdm.org>
In-Reply-To: <B2FD678A64EAAD45B089B123FDFC3ED72B9F6C21A7@inbmail01.lsi.com>
References:  <B2FD678A64EAAD45B089B123FDFC3ED72B9F6C1F79@inbmail01.lsi.com> <20120601124338.GU2358@deviant.kiev.zoral.com.ua> <B2FD678A64EAAD45B089B123FDFC3ED72B9F6C1F7F@inbmail01.lsi.com> <20120601125824.GV2358@deviant.kiev.zoral.com.ua> <B2FD678A64EAAD45B089B123FDFC3ED72B9F6C21A7@inbmail01.lsi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 05, 2012 at 17:49:05 +0530, Desai, Kashyap wrote:
> Hi All,
> 
> We found some potential area of memory leak in CAM layer. 
> CAM XPT Memory leak is due to following  function in scsi/scsi_all.c
> 
> int
> scsi_command_string(struct ccb_scsiio *csio, struct sbuf *sb)                                
> 
> 
> In above function, CAM layer allocate memory for ccb  device as below
>   if ((cgd = (struct ccb_getdev*)xpt_alloc_ccb_nowait()) == NULL)
> 
> 
> _But_, unfortunately we never free the allocated memory and we see memory leak of 2K every time when someone is calling 
> Scsi_command_string from kernel mode.
> 
> 
> Attached is a proposed patch for this issue.

The patch looks good, I just committed it.

Thanks!

Ken
-- 
Kenneth Merry
ken@FreeBSD.ORG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120606170640.GA98428>