Skip to content

Commit 2920141

Browse files
spandruvadajwrdegoede
authored andcommitted
platform/x86/intel/tpmi: Handle error from tpmi_process_info()
When tpmi_process_info() returns error, fail to load the driver. This can happen if call to ioremap() returns error. Signed-off-by: Srinivas Pandruvada <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Cc: [email protected] # v6.3+ Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 22813a1 commit 2920141

File tree

1 file changed

+5
-2
lines changed
  • drivers/platform/x86/intel

1 file changed

+5
-2
lines changed

drivers/platform/x86/intel/tpmi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,11 @@ static int intel_vsec_tpmi_init(struct auxiliary_device *auxdev)
763763
* when actual device nodes created outside this
764764
* loop via tpmi_create_devices().
765765
*/
766-
if (pfs->pfs_header.tpmi_id == TPMI_INFO_ID)
767-
tpmi_process_info(tpmi_info, pfs);
766+
if (pfs->pfs_header.tpmi_id == TPMI_INFO_ID) {
767+
ret = tpmi_process_info(tpmi_info, pfs);
768+
if (ret)
769+
return ret;
770+
}
768771

769772
if (pfs->pfs_header.tpmi_id == TPMI_CONTROL_ID)
770773
tpmi_set_control_base(auxdev, tpmi_info, pfs);

0 commit comments

Comments
 (0)