LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH][RESEND] au88x0: mem leak fix in snd_vortex_create()
@ 2007-08-04 18:30 Jesper Juhl
0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2007-08-04 18:30 UTC (permalink / raw)
To: Andrew Morton
Cc: Linux Kernel Mailing List, Manuel Jander, Jesper Juhl, alsa-devel
(resend of patch previously submitted on 04-Aug-2007 02:09)
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>
Acked-by: Rene Herman <rene.herman@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] only message in thread
only message in thread, other threads:[~2007-08-04 18:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-04 18:30 [PATCH][RESEND] au88x0: mem leak fix in snd_vortex_create() Jesper Juhl
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).