mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA: sparc: Add missing kfree in error path
@ 2015-07-17 18:33 Christophe JAILLET
  2015-07-17 20:30 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2015-07-17 18:33 UTC (permalink / raw)
  To: perex, tiwai
  Cc: alsa-devel, linux-kernel, kernel-janitors, Christophe JAILLET

If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a
memory leak.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 sound/sparc/amd7930.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index 1b1a89e..784ceb8 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -956,6 +956,7 @@ static int snd_amd7930_create(struct snd_card *card,
 	if (!amd->regs) {
 		snd_printk(KERN_ERR
 			   "amd7930-%d: Unable to map chip registers.\n", dev);
+		kfree(amd);
 		return -EIO;
 	}
 
-- 
2.1.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-17 20:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-17 18:33 [PATCH] ALSA: sparc: Add missing kfree in error path Christophe JAILLET
2015-07-17 20:30 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®