Skip to contentSkip to conversation

Input: tegra-kbc - correct call to input_free_device

PATCH RESEND In review Axel Lin 3 participants 4 messages Aug 11, 2011

Subsystems (4)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH RESEND 1/1 Input: tegra-kbc - correct call to input_free_device

If kzalloc for kbc fails, then we have NULL pointer dereference while calling input_free_device(kbc->idev) in the error handling. So it is safer to always use the original name, input_dev.

---
 drivers/input/keyboard/tegra-kbc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/keyboard/tegra-kbc.c +1 -1
index 2b3b73e..8e40f2b 100644
@@ -701,7 +701,7 @@ err_iounmap:
 err_free_mem_region:
 	release_mem_region(res->start, resource_size(res));
 err_free_mem:
-	input_free_device(kbc->idev);
+	input_free_device(input_dev);
 	kfree(kbc);
 
 	return err;
Signature · 1 line
1.7.4.1
Reviewed-by on v1 1/1
#1 lore raw

Axel Lin wrote at Thursday, August 11, 2011 2:49 AM:

Quoted 5 lines

If kzalloc for kbc fails, then we have NULL pointer dereference while calling input_free_device(kbc->idev) in the error handling. So it is safer to always use the original name, input_dev.

Quoted 19 lines
---
 drivers/input/keyboard/tegra-kbc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/keyboard/tegra-kbc.c +1 -2
index 2b3b73e..8e40f2b 100644
@@ -701,7 +701,7 @@ err_iounmap:
 err_free_mem_region:
 	release_mem_region(res->start, resource_size(res));
 err_free_mem:
-	input_free_device(kbc->idev);
+	input_free_device(input_dev);
 	kfree(kbc);
 
 	return err;
--

1.7.4.1

Signature · 1 line
nvpublic
maintainer
#2 lore raw
Quoted 8 lines · Stephen Warren

Axel Lin wrote at Thursday, August 11, 2011 2:49 AM:

Quoted 5 lines

If kzalloc for kbc fails, then we have NULL pointer dereference while calling input_free_device(kbc->idev) in the error handling. So it is safer to always use the original name, input_dev.

Gah, sorry, already pushed into my public branch so won't be able so add your reviewed-by...

Signature · 1 line
Dmitry
#3 lore raw

Dmitry Torokhov wrote at Thursday, August 11, 2011 10:52 AM:

Quoted 6 lines · Stephen Warren
Quoted 5 lines

Axel Lin wrote at Thursday, August 11, 2011 2:49 AM:

Quoted 4 lines

If kzalloc for kbc fails, then we have NULL pointer dereference while calling input_free_device(kbc->idev) in the error handling. So it is safer to always use the original name, input_dev.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Gah, sorry, already pushed into my public branch so won't be able so add your reviewed-by...

No worries; you had no reason to expect anyone to review it!

Signature · 1 line
nvpublic