[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201010311518.42998.dmitry.torokhov@gmail.com>
Date: Sun, 31 Oct 2010 15:18:42 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Stefan Richter <stefanr@...6.in-berlin.de>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
mchehab@...hat.com
Subject: Re: drivers/media/IR/ir-keytable.c::ir_getkeycode - 'retval' may be used uninitialized
On Sunday, October 31, 2010 10:51:21 am Stefan Richter wrote:
> Commit 9f470095068e "Input: media/IR - switch to using new keycode
> interface" added the following build warning:
>
> 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
>
> It is due to an actual bug but I don't know the fix.
>
The patch below should fix it. I wonder if Linus released -rc1 yet...
--
Dmitry
Input: ir-keytable - fix uninitialized variable warning
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
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@...6.in-berlin.de>
Signed-off-by: Dmitry Torokhov <dtor@...l.ru>
---
drivers/media/IR/ir-keytable.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index 9186b45..f7fafff 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists