Skip to content

Commit

Permalink
ALSA: sparc: Add missing kfree in error path
Browse files Browse the repository at this point in the history
If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a
memory leak.

Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tititiou36 authored and tiwai committed Jul 17, 2015
1 parent 67756e3 commit 25e5eaf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/sparc/amd7930.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 25e5eaf

Please sign in to comment.