mirror of
https://github.com/X11Libre/xf86-input-keyboard.git
synced 2026-03-24 01:14:04 +00:00
Init LEDs to zero before querying the value
This way if the ioctl fails we don't set any unintended LEDs, but really this patch is more to silence valgrind: ==7129== Conditional jump or move depends on uninitialised value(s) ==7129== at 0x8DF99A1: GetKbdLeds (lnx_kbd.c:79) ==7129== by 0x8DF8853: InitKBD (kbd.c:291) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
@@ -70,7 +70,7 @@ SetKbdLeds(InputInfoPtr pInfo, int leds)
|
||||
static int
|
||||
GetKbdLeds(InputInfoPtr pInfo)
|
||||
{
|
||||
char real_leds;
|
||||
char real_leds = 0;
|
||||
int leds = 0;
|
||||
|
||||
ioctl(pInfo->fd, KDGETLED, &real_leds);
|
||||
|
||||
Reference in New Issue
Block a user