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>
This commit is contained in:
Viorel Suman 2020-11-24 16:19:57 +02:00 committed by Mark Brown
parent 5b10b62989
commit 373c2cebf4
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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;
}