[PATCH] hid: fix incorrect return value for hid.

ShengYi Hung posted 1 patch 2 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250821185717.89580-1-aokblast@FreeBSD.org
hw/input/hid.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] hid: fix incorrect return value for hid.
Posted by ShengYi Hung 2 months, 3 weeks ago
The return value of hid_keyboard_write is used to set the packet's actual_length.
Therefore, return 1 to indicate a successful transfer or it should be
considered as a wrong xfer.

Signed-off-by: ShengYi Hung <aokblast@FreeBSD.org>
Sponsored by:   The FreeBSD Foundation
---
 hw/input/hid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/input/hid.c b/hw/input/hid.c
index 76bedc1844..5da9fee763 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;
 }
-- 
2.50.1