Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4b82812 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown
Browse files

ASoC: wm_adsp: fix possible memory leak in wm_adsp_load_coeff()



'file' is malloced in wm_adsp_load_coeff() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent f6161aa1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -828,7 +828,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
						&buf_list);
			if (!buf) {
				adsp_err(dsp, "Out of memory\n");
				return -ENOMEM;
				ret = -ENOMEM;
				goto out_fw;
			}

			adsp_dbg(dsp, "%s.%d: Writing %d bytes at %x\n",
@@ -865,7 +866,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
	wm_adsp_buf_free(&buf_list);
out:
	kfree(file);
	return 0;
	return ret;
}

int wm_adsp1_init(struct wm_adsp *adsp)