On Sun, 05 Aug 2007 12:55:16 -0400
Douglas Gilbert <[EMAIL PROTECTED]> wrote:

> FUJITA Tomonori wrote:
> > unsigned short is too small for sizeof(struct scatterlist) *
> > min(q->max_hw_segments, q->max_phys_segments).
> > 
> > This fixes memory leak with 4096 segments since 16 (likely sg size
> > with x86) * 4096 sets sglist_len to zero.
> > 
> > This might not happen without sg chaining support.
> > 
> > Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
> > ---
> >  drivers/scsi/sg.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> > index 2fc24e7..2c44bb0 100644
> > --- a/drivers/scsi/sg.c
> > +++ b/drivers/scsi/sg.c
> > @@ -114,7 +114,7 @@ static struct class_interface sg_interface = {
> >  
> >  typedef struct sg_scatter_hold { /* holding area for scsi scatter gather 
> > info */
> >     unsigned short k_use_sg; /* Count of kernel scatter-gather pieces */
> > -   unsigned short sglist_len; /* size of malloc'd scatter-gather list ++ */
> > +   unsigned sglist_len; /* size of malloc'd scatter-gather list ++ */
> >     unsigned bufflen;       /* Size of (aggregate) data buffer */
> >     unsigned b_malloc_len;  /* actual len malloc'ed in buffer */
> >     struct scatterlist *buffer;/* scatter list */
> 
> Tomo,
> Thanks.
> 
> Signed-off-by: Douglas Gilbert <[EMAIL PROTECTED]>

Thanks for the quick reply.

Allocating 64K contiguous memory is not good so the next thing to do
is converting sg to use the sg chaining support fully. Or it might be
time to finish the overdue task, to convert sg to use the block layer
functions.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to