Skip to contentSkip to conversation

drivers/media/IR/ir-keytable.c::ir_getkeycode - 'retval' may be used uninitialized

DISCUSSION Stefan Richter 3 participants 5 messages Oct 31, 2010 – Nov 2, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

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.

Signature · 3 lines
Stefan Richter
-=====-==-=- =-=- =====
http://arcgraph.de/sr/
#1 lore raw
Quoted 8 lines · Stefan Richter

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...

Signature · 19 lines
Dmitry

Input: ir-keytable - fix uninitialized variable warning

From: Dmitry Torokhov <[email protected]>

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 <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
---

 drivers/media/IR/ir-keytable.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/media/IR/ir-keytable.c +2 -0
index 9186b45..f7fafff 100644
@@ -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;
Acked-by
#2 lore raw
Quoted 11 lines · Dmitry Torokhov
Quoted 8 lines · Stefan Richter

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...

Looks like it missed rc1.

Quoted 7 lines

Input: ir-keytable - fix uninitialized variable warning

From: Dmitry Torokhov <[email protected]>

We were forgetting to set up proper return value in success path causing ir_getkeycode() to fail intermittently:

Quoted 6 lines

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

Signature · 2 lines
Jarod Wilson
[email protected]
#3 lore raw
Quoted 9 lines · Jarod Wilson
Quoted 7 lines · Dmitry Torokhov
Quoted 6 lines · Stefan Richter

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

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

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...

Looks like it missed rc1.

Nope, I see it there, 47c5ba53bc5e5f88b5d1bbb97acd25afc27f74eb ;)

Signature · 1 line
Dmitry
#4 lore raw
Quoted 13 lines · Dmitry Torokhov
Quoted 12 lines · Jarod Wilson
Quoted 10 lines · Dmitry Torokhov
Quoted 8 lines · Stefan Richter

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.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

The patch below should fix it. I wonder if Linus released -rc1 yet...

Looks like it missed rc1.

Nope, I see it there, 47c5ba53bc5e5f88b5d1bbb97acd25afc27f74eb ;)

Oh, damn. Sorry for the noise... I blame it on my cold... :)

Signature · 2 lines
Jarod Wilson
[email protected]