aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJithu Joseph <[email protected]>2024-01-25 00:22:50 -0800
committerHans de Goede <[email protected]>2024-01-26 20:12:16 +0100
commit8c898ec07a2fc1d4694e81097a48e94a3816308d (patch)
tree316ecd2b1f894a786f991c3f65d5107da7b8e5c0
parenta692a86efe97fe0aba7cb15f38cbce866c080689 (diff)
platform/x86/intel/ifs: Call release_firmware() when handling errors.
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 <[email protected]> Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Ashok Raj <[email protected]> Tested-by: Pengfei Xu <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
-rw-r--r--drivers/platform/x86/intel/ifs/load.c3
1 files changed, 2 insertions, 1 deletions
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);