From: ShengYi Hung Date: Mon, 15 Sep 2025 17:57:30 +0000 (-0400) Subject: hid: fix incorrect return value for hid X-Git-Tag: v10.0.6~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45cd6b147b073a1433a416c5c1b4e2015ca941ad;p=thirdparty%2Fqemu.git hid: fix incorrect return value for hid The return value of hid_keyboard_write is used to set the packet's actual_length and pass to xhci directly to allow guest know how many byte actually processed. Therefore, return 1 to indicate a successful transfer or it will be considered as a wrong xfer. Signed-off-by: ShengYi Hung Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev (cherry picked from commit 1c0f5142d921525f1023152eac63d2ff3d33e3b2) Signed-off-by: Michael Tokarev --- diff --git a/hw/input/hid.c b/hw/input/hid.c index 76bedc1844..de24cd0ef0 100644 --- a/hw/input/hid.c +++ b/hw/input/hid.c @@ -478,6 +478,7 @@ int hid_keyboard_write(HIDState *hs, uint8_t *buf, int len) ledstate |= QEMU_CAPS_LOCK_LED; } kbd_put_ledstate(ledstate); + return 1; } return 0; }