summaryrefslogtreecommitdiff
path: root/hw/kdrive
diff options
context:
space:
mode:
authorLaércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>2016-02-22 16:04:12 -0300
committerAdam Jackson <ajax@redhat.com>2016-02-22 16:34:44 -0500
commit0461bca0cb2f7918c77ed45d2cbc756cf65021be (patch)
tree86e7676720f847d5b36b103f57db78d5771cdb43 /hw/kdrive
parent30b7d7995ef70b7473e0fb170eb8ae23b8d1f4a7 (diff)
kdrive/evdev: update keyboard LEDs (#22302)
Implement missing parts in kdrive evdev driver for correct update of evdev keyboard LEDs. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22302 [ajax: Fixed deref-before-null-check bug] Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
Diffstat (limited to 'hw/kdrive')
-rw-r--r--hw/kdrive/linux/evdev.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c
index cdd45e786..8415772ac 100644
--- a/hw/kdrive/linux/evdev.c
+++ b/hw/kdrive/linux/evdev.c
@@ -442,10 +442,16 @@ EvdevKbdEnable(KdKeyboardInfo * ki)
static void
EvdevKbdLeds(KdKeyboardInfo * ki, int leds)
{
-/* struct input_event event;
+ struct input_event event;
Kevdev *ke;
- ki->driverPrivate = ke;
+ if (!ki)
+ return;
+
+ ke = ki->driverPrivate;
+
+ if (!ke)
+ return;
memset(&event, 0, sizeof(event));
@@ -468,7 +474,6 @@ EvdevKbdLeds(KdKeyboardInfo * ki, int leds)
event.code = LED_COMPOSE;
event.value = leds & (1 << 3) ? 1 : 0;
write(ke->fd, (char *) &event, sizeof(event));
-*/
}
static void