summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorViorel Suman <viorel.suman@nxp.com>2020-11-24 17:19:57 +0300
committerMark Brown <broonie@kernel.org>2020-11-25 15:54:43 +0300
commit373c2cebf42772434c8dd0deffc3b3886ea8f1eb (patch)
treeeb565f639807f5e10cde7c9bb1ac711c253c39b7 /sound
parent5b10b62989219aa527ee4fa555d1995a3b70981b (diff)
downloadlinux-373c2cebf42772434c8dd0deffc3b3886ea8f1eb.tar.xz
ASoC: fsl_xcvr: fix potential resource leak
"fw" variable must be relased before return. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> Link: https://lore.kernel.org/r/20201124141957.20481-1-viorel.suman@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_xcvr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index 2a28810d0e29..3d58c88ea603 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -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 */
if (rem > 16384) {
dev_err(dev, "FW size %d is bigger than 16KiB.\n", rem);
+ release_firmware(fw);
return -ENOMEM;
}