]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Input: ir-keytable - fix uninitialized variable warning
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 31 Oct 2010 22:18:42 +0000 (15:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Nov 2010 01:05:43 +0000 (21:05 -0400)
We were forgetting to set up proper return value in success path causing
ir_getkeycode() to fail intermittently:

drivers/media/IR/ir-keytable.c: In function 'ir_getkeycode':
drivers/media/IR/ir-keytable.c:363: warning: 'retval' may be used
uninitialized in this function

Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/media/IR/ir-keytable.c

index 647d52b1a1b75d3a38390d3ec3c9588abca28ac2..f60107c3b091b966895e48f6e1860112bbaa3482 100644 (file)
@@ -389,6 +389,8 @@ static int ir_getkeycode(struct input_dev *dev,
        ke->len = sizeof(entry->scancode);
        memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode));
 
+       retval = 0;
+
 out:
        spin_unlock_irqrestore(&rc_tab->lock, flags);
        return retval;