浏览代码

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>
Christophe JAILLET 10 年之前
父节点
当前提交
25e5eaf199
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      sound/sparc/amd7930.c

+ 1 - 0
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;
 	}