mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] platform/x86: ISST: Propagate def_ioctl errors to user space
@ 2026-11-16 21:02 Kuppuswamy Sathyanarayanan
  2026-11-19 14:42 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: Kuppuswamy Sathyanarayanan @ 2026-11-16 21:02 UTC (permalink / raw)
  To: Srinivas Pandruvada, Hans de Goede, Ilpo Järvinen
  Cc: Piotr Kubaj, platform-driver-x86, linux-kernel

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@intel.com>
Co-developed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 .../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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-19 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 21:02 [PATCH v1] platform/x86: ISST: Propagate def_ioctl errors to user space Kuppuswamy Sathyanarayanan
2026-11-19 14:42 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®