* [PATCH] staging: greybus: hid: fix SET_REPORT return value
@ 2026-07-04 8:16 Hao-Qun Huang
2026-07-09 10:52 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Hao-Qun Huang @ 2026-07-04 8:16 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Viresh Kumar, Johan Hovold, Alex Elder, greybus-dev,
linux-staging, linux-kernel, Hao-Qun Huang, stable
__gb_hid_output_raw_report() stores the result of gb_hid_set_report()
in ret and even adjusts it to account for the report ID byte, but then
always returns 0.
This hides Greybus transport errors from HID_REQ_SET_REPORT callers,
and makes hidraw report zero bytes written to user space on success,
although hid_hw_raw_request() is expected to return the number of
bytes transferred or a negative errno. The sibling GET_REPORT path,
__gb_hid_get_raw_report(), already follows this convention.
Return ret like the other HID transport drivers do.
Fixes: 96eab779e198 ("greybus: hid: add HID class driver")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-fable-5
Signed-off-by: Hao-Qun Huang <alvinhuang0603@gmail.com>
---
diff --git a/drivers/staging/greybus/hid.c b/drivers/staging/greybus/hid.c
index f1f9f6fbc00e..1d7186eecd23 100644
--- a/drivers/staging/greybus/hid.c
+++ b/drivers/staging/greybus/hid.c
@@ -256,7 +256,7 @@ static int __gb_hid_output_raw_report(struct hid_device *hid, __u8 *buf,
if (report_id && ret >= 0)
ret++; /* add report_id to the number of transferred bytes */
- return 0;
+ return ret;
}
static int gb_hid_raw_request(struct hid_device *hid, unsigned char reportnum,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: greybus: hid: fix SET_REPORT return value
2026-07-04 8:16 [PATCH] staging: greybus: hid: fix SET_REPORT return value Hao-Qun Huang
@ 2026-07-09 10:52 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-07-09 10:52 UTC (permalink / raw)
To: Hao-Qun Huang
Cc: Greg Kroah-Hartman, Viresh Kumar, Johan Hovold, Alex Elder,
greybus-dev, linux-staging, linux-kernel, stable
On Sat, Jul 04, 2026 at 04:16:13PM +0800, Hao-Qun Huang wrote:
> __gb_hid_output_raw_report() stores the result of gb_hid_set_report()
> in ret and even adjusts it to account for the report ID byte, but then
> always returns 0.
>
> This hides Greybus transport errors from HID_REQ_SET_REPORT callers,
> and makes hidraw report zero bytes written to user space on success,
> although hid_hw_raw_request() is expected to return the number of
> bytes transferred or a negative errno. The sibling GET_REPORT path,
> __gb_hid_get_raw_report(), already follows this convention.
>
> Return ret like the other HID transport drivers do.
>
> Fixes: 96eab779e198 ("greybus: hid: add HID class driver")
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Hao-Qun Huang <alvinhuang0603@gmail.com>
> ---
These kinds of changes require testing. How have you tested this
change?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-09 10:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-04 8:16 [PATCH] staging: greybus: hid: fix SET_REPORT return value Hao-Qun Huang
2026-07-09 10:52 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox