Kernel panic in FreeBSD-8.3 from UFS

John Baldwin jhb at freebsd.org
Wed Jun 6 14:05:44 UTC 2012


On Tuesday, June 05, 2012 8:19:05 am 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 correct to me.  Can one of the CAM folks (Ken?) review it and 
commit it?

-- 
John Baldwin


More information about the freebsd-fs mailing list