From: Jeff Muizelaar The attached patch lets the seq_file api take care of buffer allocation instead of doing it by hand. --- kernel/dma.c | 15 +-------------- 1 files changed, 1 insertion(+), 14 deletions(-) diff -puN kernel/dma.c~proc_dma_open-simplification kernel/dma.c --- 25/kernel/dma.c~proc_dma_open-simplification 2004-01-15 19:30:16.000000000 -0800 +++ 25-akpm/kernel/dma.c 2004-01-15 19:30:16.000000000 -0800 @@ -136,20 +136,7 @@ static int proc_dma_show(struct seq_file static int proc_dma_open(struct inode *inode, struct file *file) { - char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); - struct seq_file *m; - int res; - - if (!buf) - return -ENOMEM; - res = single_open(file, proc_dma_show, NULL); - if (!res) { - m = file->private_data; - m->buf = buf; - m->size = PAGE_SIZE; - } else - kfree(buf); - return res; + return single_open(file, proc_dma_show, NULL); } static struct file_operations proc_dma_operations = { _