LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] au88x0: mem leak fix in snd_vortex_create()
@ 2007-08-04 0:09 Jesper Juhl
2007-08-04 9:47 ` Rene Herman
2007-08-06 12:06 ` Takashi Iwai
0 siblings, 2 replies; 3+ messages in thread
From: Jesper Juhl @ 2007-08-04 0:09 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: Manuel Jander, Jesper Juhl, alsa-devel
Hi,
In sound/pci/au88x0/au88x0.c::snd_vortex_create() :
The Coverity checker found that if we allocate storage for 'chip'
but then leave via the regions_out: label, then we end up leaking
the storage allocated for 'chip'.
I believe simply freeing 'chip' before the "return err;" line is
all we need to fix this, but please double-check me :)
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index 5ec1b6f..f70286a 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -232,6 +232,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
pci_disable_device(chip->pci_dev);
//FIXME: this not the right place to unregister the gameport
vortex_gameport_unregister(chip);
+ kfree(chip);
return err;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] au88x0: mem leak fix in snd_vortex_create()
2007-08-04 0:09 [PATCH] au88x0: mem leak fix in snd_vortex_create() Jesper Juhl
@ 2007-08-04 9:47 ` Rene Herman
2007-08-06 12:06 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Rene Herman @ 2007-08-04 9:47 UTC (permalink / raw)
To: Jesper Juhl; +Cc: Linux Kernel Mailing List, Manuel Jander, alsa-devel
On 08/04/2007 02:09 AM, Jesper Juhl wrote:
> In sound/pci/au88x0/au88x0.c::snd_vortex_create() :
> The Coverity checker found that if we allocate storage for 'chip'
> but then leave via the regions_out: label, then we end up leaking
> the storage allocated for 'chip'.
> I believe simply freeing 'chip' before the "return err;" line is
> all we need to fix this, but please double-check me :)
>
>
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> ---
>
> diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
> index 5ec1b6f..f70286a 100644
> --- a/sound/pci/au88x0/au88x0.c
> +++ b/sound/pci/au88x0/au88x0.c
> @@ -232,6 +232,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
> pci_disable_device(chip->pci_dev);
> //FIXME: this not the right place to unregister the gameport
> vortex_gameport_unregister(chip);
> + kfree(chip);
> return err;
> }
ACK.
Rene.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] au88x0: mem leak fix in snd_vortex_create()
2007-08-04 0:09 [PATCH] au88x0: mem leak fix in snd_vortex_create() Jesper Juhl
2007-08-04 9:47 ` Rene Herman
@ 2007-08-06 12:06 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2007-08-06 12:06 UTC (permalink / raw)
To: Jesper Juhl; +Cc: Linux Kernel Mailing List, Manuel Jander, alsa-devel
At Sat, 4 Aug 2007 02:09:25 +0200,
Jesper Juhl wrote:
>
> Hi,
>
> In sound/pci/au88x0/au88x0.c::snd_vortex_create() :
> The Coverity checker found that if we allocate storage for 'chip'
> but then leave via the regions_out: label, then we end up leaking
> the storage allocated for 'chip'.
> I believe simply freeing 'chip' before the "return err;" line is
> all we need to fix this, but please double-check me :)
>
>
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Thanks, applied to ALSA tree now.
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-06 12:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-04 0:09 [PATCH] au88x0: mem leak fix in snd_vortex_create() Jesper Juhl
2007-08-04 9:47 ` Rene Herman
2007-08-06 12:06 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).