Skip to contentSkip to conversation

hid: fix incorrect return value for hid.

PATCH New ShengYi Hung 1 participant 1 message Aug 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hid: fix incorrect return value for hid.

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.

Sponsored by: The FreeBSD Foundation

---
 hw/input/hid.c | 1 +
 1 file changed, 1 insertion(+)
hw/input/hid.c +1 -0
index 76bedc1844..5da9fee763 100644
@@ -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;
 }
Signature · 1 line
2.50.1