Skip to content

Commit 46ee21e

Browse files
spandruvadaij-intel
authored andcommitted
platform/x86: ISST: Fix return value on last invalid resource
When only the last resource is invalid, tpmi_sst_dev_add() is returing error even if there are other valid resources before. This function should return error when there are no valid resources. Here tpmi_sst_dev_add() is returning "ret" variable. But this "ret" variable contains the failure status of last call to sst_main(), which failed for the invalid resource. But there may be other valid resources before the last entry. To address this, do not update "ret" variable for sst_main() return status. If there are no valid resources, it is already checked for by !inst below the loop and -ENODEV is returned. Fixes: 9d1d362 ("platform/x86: ISST: Support partitioned systems") Signed-off-by: Srinivas Pandruvada <[email protected]> Cc: [email protected] # 6.10+ Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent bc923d5 commit 46ee21e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,8 +1549,7 @@ int tpmi_sst_dev_add(struct auxiliary_device *auxdev)
15491549
goto unlock_free;
15501550
}
15511551

1552-
ret = sst_main(auxdev, &pd_info[i]);
1553-
if (ret) {
1552+
if (sst_main(auxdev, &pd_info[i])) {
15541553
/*
15551554
* This entry is not valid, hardware can partially
15561555
* populate dies. In this case MMIO will have 0xFFs.

0 commit comments

Comments
 (0)