summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Wolf <W_Armin@gmx.de>2026-06-12 19:34:50 +0200
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-07-09 16:42:49 +0300
commitadfd6846bea13667ff28f8aaf00c32fbd69825ab (patch)
treee72fab03af8713b5a88fe2ae84b02e491818fd3f
parent072841e02cf9c00a7e8a9c567a14239e02ca47ad (diff)
downloadlinux-adfd6846bea13667ff28f8aaf00c32fbd69825ab.tar.gz
linux-adfd6846bea13667ff28f8aaf00c32fbd69825ab.zip
platform/x86: dell-wmi-base: Fix handling of ultra performance key
The commit message of commit 5fbd827eb9c2 ("platform/x86: dell-wmi: Recognise or support new switches") states that the ultra performance key contains additional data after the type and code fields. The event data passed to dell_wmi_process_key() is already parsed, so "buffer" already starts after those two fields. Use the correct index for accessing the first data field to avoid a potential buffer overread. Fixes: 5fbd827eb9c2 ("platform/x86: dell-wmi: Recognise or support new switches") Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://patch.msgid.link/20260612173451.467629-4-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-rw-r--r--drivers/platform/x86/dell/dell-wmi-base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c
index fd6a508cd902..38a6b3ae2f75 100644
--- a/drivers/platform/x86/dell/dell-wmi-base.c
+++ b/drivers/platform/x86/dell/dell-wmi-base.c
@@ -456,7 +456,7 @@ static int dell_wmi_process_key(struct wmi_device *wdev, int type, int code, __l
key++;
used = 1;
} else if (type == 0x0012 && code == 0x000d && remaining > 0) {
- value = (le16_to_cpu(buffer[2]) == 2);
+ value = (le16_to_cpu(buffer[0]) == 2);
used = 1;
}