Skip to content

Commit 7437476

Browse files
committed
platform/x86: ISST: Fix return value on last invalid resource
JIRA: https://issues.redhat.com/browse/RHEL-65196 commit 46ee21e Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Date: Fri Aug 16 09:36:26 2024 -0700 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 <srinivas.pandruvada@linux.intel.com> Cc: stable@vger.kernel.org # 6.10+ Link: https://lore.kernel.org/r/20240816163626.415762-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Steve Best <sbest@redhat.com>
1 parent 4c6d874 commit 7437476

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
@@ -1550,8 +1550,7 @@ int tpmi_sst_dev_add(struct auxiliary_device *auxdev)
15501550
goto unlock_free;
15511551
}
15521552

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

0 commit comments

Comments
 (0)