lkml.org 
[lkml]   [1999]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Subject[PATCH] serious (?) off-by one error in 2.0.36 sound card driver code
Date
From
While trying to find a serious DMA memory leak somewhere in the RedHat
5.1 kernel, I ran into the following.

If I understand what is going on, it looks as though there is an
off-by one error in drivers/sound/dmabuf.c that could be pretty
serious. A patch is attached.

Haven't found the memory leak, though. Debug printk()'s indicate that
the sound card is freeing what it allocates for DMA. It seems to
happen under disk load, so maybe it's a problem in the disk driver
(ncr53c8xx)...

Joe Buehler

*** dmabuf.c.old Wed Apr 28 22:44:03 1999
--- dmabuf.c Wed Apr 28 22:44:07 1999
***************
*** 120,126 ****
for (sz = 0, size = PAGE_SIZE; size < dmap->buffsize; sz++, size <<= 1);

start_addr = (unsigned long) dmap->raw_buf;
! end_addr = start_addr + dmap->buffsize;

for (i = MAP_NR(start_addr); i <= MAP_NR(end_addr); i++)
clear_bit(PG_reserved, &mem_map[i].flags);;
--- 120,126 ----
for (sz = 0, size = PAGE_SIZE; size < dmap->buffsize; sz++, size <<= 1);

start_addr = (unsigned long) dmap->raw_buf;
! end_addr = start_addr + dmap->buffsize - 1;

for (i = MAP_NR(start_addr); i <= MAP_NR(end_addr); i++)
clear_bit(PG_reserved, &mem_map[i].flags);;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:5.228 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site