From: Viorel Suman Date: Tue, 24 Nov 2020 14:19:57 +0000 (+0200) Subject: ASoC: fsl_xcvr: fix potential resource leak X-Git-Tag: v5.11-rc1~168^2^2^2~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=373c2cebf42772434c8dd0deffc3b3886ea8f1eb;p=thirdparty%2Fkernel%2Flinux.git ASoC: fsl_xcvr: fix potential resource leak "fw" variable must be relased before return. Signed-off-by: Viorel Suman Link: https://lore.kernel.org/r/20201124141957.20481-1-viorel.suman@oss.nxp.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index 2a28810d0e291..3d58c88ea603d 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; }