This is a note to let you know that I've just added the patch titled platform/x86/intel/ifs: Call release_firmware() when handling errors. to the 6.7-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: platform-x86-intel-ifs-call-release_firmware-when-ha.patch and it can be found in the queue-6.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 3feddba66bb6ced7403aefe4a09b9bcdc5b73c74 Author: Jithu Joseph <jithu.joseph@xxxxxxxxx> Date: Thu Jan 25 00:22:50 2024 -0800 platform/x86/intel/ifs: Call release_firmware() when handling errors. [ Upstream commit 8c898ec07a2fc1d4694e81097a48e94a3816308d ] Missing release_firmware() due to error handling blocked any future image loading. Fix the return code and release_fiwmare() to release the bad image. Fixes: 25a76dbb36dd ("platform/x86/intel/ifs: Validate image size") Reported-by: Pengfei Xu <pengfei.xu@xxxxxxxxx> Signed-off-by: Jithu Joseph <jithu.joseph@xxxxxxxxx> Signed-off-by: Ashok Raj <ashok.raj@xxxxxxxxx> Tested-by: Pengfei Xu <pengfei.xu@xxxxxxxxx> Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20240125082254.424859-2-ashok.raj@xxxxxxxxx Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c index a1ee1a74fc3c..2cf3b4a8813f 100644 --- a/drivers/platform/x86/intel/ifs/load.c +++ b/drivers/platform/x86/intel/ifs/load.c @@ -399,7 +399,8 @@ int ifs_load_firmware(struct device *dev) if (fw->size != expected_size) { dev_err(dev, "File size mismatch (expected %u, actual %zu). Corrupted IFS image.\n", expected_size, fw->size); - return -EINVAL; + ret = -EINVAL; + goto release; } ret = image_sanity_check(dev, (struct microcode_header_intel *)fw->data);