[PATCH] ALSA: sparc: Add missing kfree in error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux