* [PATCH] drivers/hid: fix brackets in comments
@ 2026-11-21 8:56 Manuel Ebner
2026-11-21 9:02 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Manuel Ebner @ 2026-11-21 8:56 UTC (permalink / raw)
To: Basavaraj Natikar, Jiri Kosina, Benjamin Tissoires, Ping Cheng,
Jason Gerecke
Cc: Manuel Ebner, linux-input, linux-kernel
Remove multiple ')' without opening '(' and add missing '(' in comments.
Signed-off-by: Manuel Ebner <manuelebnerli@mailbox.org>
---
.../hid_descriptor/amd_sfh_hid_report_desc.h | 12 ++++++------
drivers/hid/wacom_wac.c | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h b/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h
index 67ec2d6a417d..6c331c2c63b8 100644
--- a/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h
+++ b/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h
@@ -81,7 +81,7 @@ static const u8 accel3_report_descriptor[] = {
0x95, 1, /* HID report count(1) */
0x55, 0, /* HID unit exponent(0) */
0xB1, 0x02, /* HID feature (Data_Arr_Abs) */
-0x0A, 0x52, 0x14, /* Sensor data motion accel and mod change sensitivity ABS) */
+0x0A, 0x52, 0x14, /* Sensor data motion accel and mod change sensitivity ABS */
0x15, 0, /* HID logical Min_8(0) */
0x26, 0xFF, 0xFF, /* HID logical Max_16(0xFF,0xFF) */
@@ -248,7 +248,7 @@ static const u8 gyro3_report_descriptor[] = {
0x95, 1, /* HID report count(1) */
0x55, 0, /* HID unit exponent(0) */
0xB1, 0x02, /* HID feature (Data_Arr_Abs) */
-0x0A, 0x56, 0x14, /* Angular velocity and mod change sensitivity ABS)*/
+0x0A, 0x56, 0x14, /* Angular velocity and mod change sensitivity ABS*/
0x15, 0, /* HID logical Min_8(0) */
0x26, 0xFF, 0xFF, /* HID logical Max_16(0xFF,0xFF) */
@@ -408,7 +408,7 @@ static const u8 comp3_report_descriptor[] = {
0x95, 1, /* HID report count(1) */
0x55, 0, /* HID unit exponent(0) */
0xB1, 0x02, /* HID feature (Data_Arr_Abs) */
-0x0A, 0x71, 0x14, /* Orientation and mod change sensitivity ABS)*/
+0x0A, 0x71, 0x14, /* Orientation and mod change sensitivity ABS*/
0x15, 0, /* HID logical Min_8(0) */
0x26, 0xFF, 0xFF, /* HID logical Max_16(0xFF,0xFF) */
0x75, 16, /* HID report size(16) */
@@ -429,14 +429,14 @@ static const u8 comp3_report_descriptor[] = {
0x95, 1, /* HID report count(1) */
0x55, 0x0F, /* HID unit exponent(0x0F) */
0xB1, 0x02, /* HID feature (Data_Arr_Abs) */
-0x0A, 0x84, 0x14, /* Maganetic flux and change sensitivity ABS) */
+0x0A, 0x84, 0x14, /* Maganetic flux and change sensitivity ABS */
0x15, 0, /* HID logical Min_8(0) */
0x26, 0xFF, 0xFF, /* HID logical Max_16(0xFF,0xFF) */
0x75, 16, /* HID report size(16) */
0x95, 1, /* HID report count(1) */
0x55, 0x0E, /* HID unit exponent(0x0E) */
0xB1, 0x02, /* HID feature (Data_Arr_Abs) */
-0x0A, 0x84, 0x24, /* Maganetic flux and mod change sensitivity Max) */
+0x0A, 0x84, 0x24, /* Maganetic flux and mod change sensitivity Max */
0x16, 0x01, 0x80, /* HID logical Min_16(0x01,0x80) */
0x26, 0xFF, 0x7F, /* HID logical Max_16(0xFF,0x7F) */
0x75, 16, /* HID report size(16) */
@@ -581,7 +581,7 @@ static const u8 als_report_descriptor[] = {
0x95, 1, /* HID report count(1) */
0x55, 0, /* HID unit exponent(0) */
0xB1, 0x02, /* HID feature (Data_Arr_Abs) */
-0x0A, 0xD1, 0xE4, /* Light illuminance and sensitivity REL PCT) */
+0x0A, 0xD1, 0xE4, /* Light illuminance and sensitivity REL PCT */
0x15, 0, /* HID logical Min_8(0) */
0x26, 0x10, 0x27, /* HID logical Max_16(0x10,0x27) */
0x75, 16, /* HID report size(16) */
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index da1f0ea85625..b7aa6b60fb02 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -546,7 +546,7 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
* physically implemented as a touchstrip. Each button
* is approximately 3 bits wide with a 2 bit spacing.
* The raw touchstrip bits are stored at:
- * ((data[3] & 0x1f) << 8) | data[4])
+ * (((data[3] & 0x1f) << 8) | data[4])
*/
nkeys = 3;
keys = ((data[3] & 0x1C) ? 1<<2 : 0) |
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/hid: fix brackets in comments
2026-11-21 8:56 [PATCH] drivers/hid: fix brackets in comments Manuel Ebner
@ 2026-11-21 9:02 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-21 9:02 UTC (permalink / raw)
To: Manuel Ebner; +Cc: linux-input, dmitry.torokhov
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] HID: wacom: null pointer dereference in wacom_intuos_irq()
[1]
--
commit fe38a9c78cbb9c5469865293835934f3d81cedd9
Author: Manuel Ebner <manuelebnerli@mailbox.org>
drivers/hid: fix brackets in comments
This commit removes unmatched closing parentheses and adds a missing
opening parenthesis in comments in the AMD SFH and Wacom HID drivers.
> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> index 361738bb87253..0273299454b74 100644
> --- a/drivers/hid/wacom_wac.c
> +++ b/drivers/hid/wacom_wac.c
> @@ -558,7 +558,7 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
> * physically implemented as a touchstrip. Each button
> * is approximately 3 bits wide with a 2 bit spacing.
> * The raw touchstrip bits are stored at:
> - * ((data[3] & 0x1f) << 8) | data[4])
> + * (((data[3] & 0x1f) << 8) | data[4])
> */
> nkeys = 3;
> keys = ((data[3] & 0x1C) ? 1<<2 : 0) |
[Severity: Critical]
This problem wasn't introduced by this patch, but can wacom_intuos_pad()
and wacom_intuos_irq() dereference a NULL wacom->pad_input or
wacom->pen_input pointer [1]?
When a device interface lacks pen or pad capabilities, the driver does not
allocate the corresponding input_dev, leaving wacom->pen_input or
wacom->pad_input NULL. If a report arrives on that interface,
wacom_intuos_irq() dereferences wacom->pen_input in dev_dbg() on unknown
report IDs, or dispatches recognized reports to wacom_intuos_pad() and
wacom_intuos_general(), which report events through wacom->pad_input and
wacom->pen_input without checking whether they were allocated:
drivers/hid/wacom_wac.c:wacom_intuos_irq() {
unsigned char *data = wacom->data;
struct input_dev *input = wacom->pen_input;
int result;
if (data[0] != WACOM_REPORT_PENABLED &&
...
data[0] != WACOM_REPORT_INTUOS5PAD) {
dev_dbg(input->dev.parent,
"%s: received unknown report #%d\n", __func__, data[0]);
return 0;
}
/* process pad events */
result = wacom_intuos_pad(wacom);
if (result)
return result;
...
/* process general packets */
result = wacom_intuos_general(wacom);
...
}
Receiving a crafted report on an interface without the corresponding
input_dev triggers a NULL pointer dereference and crashes the kernel.
[1] https://sashiko.dev/#/bug/linux-4a2bc3f1-bd42-421b-b885-0a54a4969fdf
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261121085628.1430330-2-manuelebnerli@mailbox.org?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-21 9:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21 8:56 [PATCH] drivers/hid: fix brackets in comments Manuel Ebner
2026-11-21 9:02 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox