From: Dmitry Torokhov Date: Sun, 31 Oct 2010 22:18:42 +0000 (-0700) Subject: Input: ir-keytable - fix uninitialized variable warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=47c5ba53bc5e5f88b5d1bbb97acd25afc27f74eb;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Input: ir-keytable - fix uninitialized variable warning 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 Signed-off-by: Dmitry Torokhov Signed-off-by: Linus Torvalds --- diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 647d52b1a1b7..f60107c3b091 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c @@ -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;