Re: [2.6 patch] sound/: fix some memory leaks

From: Takashi Iwai
Date: Tue Mar 14 2006 - 04:36:33 EST


At Mon, 13 Mar 2006 23:26:47 +0100,
Adrian Bunk wrote:
>
> This patch fixes two memory leaks spotted by the Coverity checker.
>
>
> Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>
>
> ---
>
> sound/drivers/serial-u16550.c | 1 +
> sound/isa/es18xx.c | 1 +
> sound/pci/cs46xx/dsp_spos.c | 10 +++++++---
> 3 files changed, 9 insertions(+), 3 deletions(-)
>
> --- linux-2.6.16-rc6-mm1-full/sound/drivers/serial-u16550.c.old 2006-03-13 22:52:25.000000000 +0100
> +++ linux-2.6.16-rc6-mm1-full/sound/drivers/serial-u16550.c 2006-03-13 22:52:59.000000000 +0100
> @@ -789,6 +789,7 @@ static int __init snd_uart16550_create(s
>
> if ((err = snd_uart16550_detect(uart)) <= 0) {
> printk(KERN_ERR "no UART detected at 0x%lx\n", iobase);
> + kfree(uart);
> return -ENODEV;
> }

This one may leave a requested region after free. It should be
snd_uart16550_free(uart), instead.

Others look fine. I'll apply them with the fix above to ALSA tree.


Thanks!

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