Skip to content

Commit 8c898ec

Browse files
jithu83jwrdegoede
authored andcommitted
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: 25a76db ("platform/x86/intel/ifs: Validate image size") Reported-by: Pengfei Xu <pengfei.xu@intel.com> Signed-off-by: Jithu Joseph <jithu.joseph@intel.com> Signed-off-by: Ashok Raj <ashok.raj@intel.com> Tested-by: Pengfei Xu <pengfei.xu@intel.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240125082254.424859-2-ashok.raj@intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent a692a86 commit 8c898ec

File tree

1 file changed

+2
-1
lines changed
  • drivers/platform/x86/intel/ifs

1 file changed

+2
-1
lines changed

drivers/platform/x86/intel/ifs/load.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@ int ifs_load_firmware(struct device *dev)
399399
if (fw->size != expected_size) {
400400
dev_err(dev, "File size mismatch (expected %u, actual %zu). Corrupted IFS image.\n",
401401
expected_size, fw->size);
402-
return -EINVAL;
402+
ret = -EINVAL;
403+
goto release;
403404
}
404405

405406
ret = image_sanity_check(dev, (struct microcode_header_intel *)fw->data);

0 commit comments

Comments
 (0)