ASoC: Intel: sst: Fix firmware resource leak in sst_request_fw()
Subsystems (3)
PATCH 1/1 ASoC: Intel: sst: Fix firmware resource leak in sst_request_fw()
From: Aravind Anilraj <[email protected]>
The sst_request_fw() function calls request_firmware() but does not release the firmware on any return path, resulting in a resource leak.
Ensure release_firmware() is called after the firmware has been processed to properly free the allocated resources.
This issue was identified by smatch.
Signed-off-by Aravind Anilraj <[email protected]>
--- sound/soc/intel/atom/sst/sst_loader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/intel/atom/sst/sst_loader.c +4 -2
@@ -350,12 +350,14 @@ static int sst_request_fw(struct intel_sst_drv *sst) }if (fw ==NULL ) {dev_err (sst->dev,"fw is returning as null\n" ); -return -EINVAL ; + retval = -EINVAL ; + goto out; }mutex_lock (&sst->sst_lock); retval =sst_cache_and_parse_fw (sst, fw);mutex_unlock (&sst->sst_lock); - +out: +release_firmware (fw);return retval; }
Signature · 1 line
2.47.3