[PATCH v1] platform/x86: ISST: Propagate def_ioctl errors to user space

From: Kuppuswamy Sathyanarayanan

Date: Mon Nov 16 2026 - 16:02:45 EST


isst_if_def_ioctl() declares an inner "int ret" that shadows the outer
"long ret". When the TPMI def_ioctl callback fails, its error is lost
and user space always sees -ENOTTY.

Remove the inner variable. Return the callback result unless it is
-ENOTTY.

Fixes: 33c16dc1a2d1 ("platform/x86: ISST: Add IOCTL default callback")
Reported-by: Piotr Kubaj <piotr.kubaj@xxxxxxxxx>
Co-developed-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>
---
.../platform/x86/intel/speed_select_if/isst_if_common.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c
index 4c04f0bc9b47..fecb908bc88c 100644
--- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c
+++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c
@@ -614,12 +614,12 @@ static long isst_if_def_ioctl(struct file *file, unsigned int cmd,
default:
for (i = 0; i < ISST_IF_DEV_MAX; ++i) {
struct isst_if_cmd_cb *cb = &punit_callbacks[i];
- int ret;

if (cb->def_ioctl) {
- ret = cb->def_ioctl(file, cmd, arg);
- if (!ret)
- return ret;
+ long def_ret = cb->def_ioctl(file, cmd, arg);
+
+ if (def_ret != -ENOTTY)
+ return def_ret;
}
}
break;
--
2.43.0