usb_drv: wait for keyboard LED registry in 'led_connect()'

It can happen that a keyboard gets plugged in and 'led_connect()' is
called while the keyboard LED of another keyboard is just being updated
(and the registry is locked).

Fixes #2869
This commit is contained in:
Christian Prochaska 2018-06-15 13:01:53 +02:00 committed by Norman Feske
parent 96112ec66d
commit 38ae718509

View File

@ -449,6 +449,8 @@ static Genode::Constructible<Usb::Led> _led;
static int led_connect(struct input_handler *handler, struct input_dev *dev,
const struct input_device_id *id)
{
_led->wait_for_registry();
Keyboard_led *keyboard = new (Lx_kit::env().heap()) Keyboard_led(_registry, dev);
_led->update(*keyboard);