浏览代码

ASoC: wm_adsp: Release firmware on error

This patch correctly releases the firmware if the magic string in the
firmware header does not match.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Charles Keepax 12 年之前
父节点
当前提交
a4cdbec758
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      sound/soc/codecs/wm_adsp.c

+ 1 - 1
sound/soc/codecs/wm_adsp.c

@@ -396,7 +396,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
 	hdr = (void*)&firmware->data[0];
 	if (memcmp(hdr->magic, "WMDR", 4) != 0) {
 		adsp_err(dsp, "%s: invalid magic\n", file);
-		return -EINVAL;
+		goto out_fw;
 	}
 
 	adsp_dbg(dsp, "%s: v%d.%d.%d\n", file,