From: Christophe JAILLET Date: Fri, 17 Jul 2015 18:33:21 +0000 (+0200) Subject: ALSA: sparc: Add missing kfree in error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=25e5eaf19962bd48788371e4f516bdd89ce248bc;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git ALSA: sparc: Add missing kfree in error path If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a memory leak. Signed-off-by: Christophe JAILLET Signed-off-by: Takashi Iwai --- diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index 1b1a89e80d13..784ceb85b2d9 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; }