Commit 373c2ceb authored by Viorel Suman's avatar Viorel Suman Committed by Mark Brown

ASoC: fsl_xcvr: fix potential resource leak

"fw" variable must be relased before return.
Signed-off-by: default avatarViorel Suman <viorel.suman@nxp.com>
Link: https://lore.kernel.org/r/20201124141957.20481-1-viorel.suman@oss.nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5b10b629
...@@ -706,6 +706,7 @@ static int fsl_xcvr_load_firmware(struct fsl_xcvr *xcvr) ...@@ -706,6 +706,7 @@ static int fsl_xcvr_load_firmware(struct fsl_xcvr *xcvr)
/* RAM is 20KiB = 16KiB code + 4KiB data => max 10 pages 2KiB each */ /* RAM is 20KiB = 16KiB code + 4KiB data => max 10 pages 2KiB each */
if (rem > 16384) { if (rem > 16384) {
dev_err(dev, "FW size %d is bigger than 16KiB.\n", rem); dev_err(dev, "FW size %d is bigger than 16KiB.\n", rem);
release_firmware(fw);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment