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 <christophe.jaillet@wanadoo.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Christophe JAILLET 2015-07-17 20:33:21 +02:00 committed by Takashi Iwai
parent 67756e3191
commit 25e5eaf199
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}