linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: gpio-keys - fix possible NULL pointer dereference
@ 2008-07-30 13:27 Uwe Kleine-König
  2008-07-30 13:27 ` [PATCH] Input: gpio-keys - make gpio_keys_device_driver static Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2008-07-30 13:27 UTC (permalink / raw)
  To: linux-input; +Cc: Dmitry Baryshkov, Dmitry Torokhov

bdata->button is used in gpio_check_button but never initialized.  Having a
device with debounce_interval != 0 without this patch resulted on an oops on
my machine.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
---
 drivers/input/keyboard/gpio_keys.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index be58730..1a92f4b 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -118,6 +118,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
 		unsigned int type = button->type ?: EV_KEY;
 
 		bdata->input = input;
+		bdata->button = button;
 		setup_timer(&bdata->timer,
 			    gpio_check_button, (unsigned long)bdata);
 
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] Input: gpio-keys - make gpio_keys_device_driver static
  2008-07-30 13:27 [PATCH] Input: gpio-keys - fix possible NULL pointer dereference Uwe Kleine-König
@ 2008-07-30 13:27 ` Uwe Kleine-König
  2008-07-30 13:32 ` [PATCH] Input: gpio-keys - fix possible NULL pointer dereference Uwe Kleine-König
  2008-07-30 14:53 ` Dmitry Torokhov
  2 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2008-07-30 13:27 UTC (permalink / raw)
  To: linux-input

This fixes the sparse warning

	symbol 'gpio_keys_device_driver' was not declared. Should it be static?

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
---
 drivers/input/keyboard/gpio_keys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 1a92f4b..3f48279 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -257,7 +257,7 @@ static int gpio_keys_resume(struct platform_device *pdev)
 #define gpio_keys_resume	NULL
 #endif
 
-struct platform_driver gpio_keys_device_driver = {
+static struct platform_driver gpio_keys_device_driver = {
 	.probe		= gpio_keys_probe,
 	.remove		= __devexit_p(gpio_keys_remove),
 	.suspend	= gpio_keys_suspend,
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Input: gpio-keys - fix possible NULL pointer dereference
  2008-07-30 13:27 [PATCH] Input: gpio-keys - fix possible NULL pointer dereference Uwe Kleine-König
  2008-07-30 13:27 ` [PATCH] Input: gpio-keys - make gpio_keys_device_driver static Uwe Kleine-König
@ 2008-07-30 13:32 ` Uwe Kleine-König
  2008-07-30 14:53 ` Dmitry Torokhov
  2 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2008-07-30 13:32 UTC (permalink / raw)
  To: linux-input; +Cc: Dmitry Baryshkov, Dmitry Torokhov

Hello,

I forgot to mention that you can pull these changes from

	git://www.modarm9.com/gitsrc/pub/people/ukleinek/linux-2.6.git gpio-keys-fixes

Just in case you prefer it this way ...

Best regards
Uwe

-- 
Uwe Kleine-König, Software Engineer
Digi International GmbH Branch Breisach, Küferstrasse 8, 79206 Breisach, Germany
Tax: 315/5781/0242 / VAT: DE153662976 / Reg. Amtsgericht Dortmund HRB 13962
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Input: gpio-keys - fix possible NULL pointer dereference
  2008-07-30 13:27 [PATCH] Input: gpio-keys - fix possible NULL pointer dereference Uwe Kleine-König
  2008-07-30 13:27 ` [PATCH] Input: gpio-keys - make gpio_keys_device_driver static Uwe Kleine-König
  2008-07-30 13:32 ` [PATCH] Input: gpio-keys - fix possible NULL pointer dereference Uwe Kleine-König
@ 2008-07-30 14:53 ` Dmitry Torokhov
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2008-07-30 14:53 UTC (permalink / raw)
  To: Uwe Kleine-K??nig; +Cc: linux-input, Dmitry Baryshkov

Hi Uwe,

On Wed, Jul 30, 2008 at 03:27:10PM +0200, Uwe Kleine-K??nig wrote:
> bdata->button is used in gpio_check_button but never initialized.  Having a
> device with debounce_interval != 0 without this patch resulted on an oops on
> my machine.
> 

Applied both patches to 'for-linus' branch, thanks!

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-30 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-30 13:27 [PATCH] Input: gpio-keys - fix possible NULL pointer dereference Uwe Kleine-König
2008-07-30 13:27 ` [PATCH] Input: gpio-keys - make gpio_keys_device_driver static Uwe Kleine-König
2008-07-30 13:32 ` [PATCH] Input: gpio-keys - fix possible NULL pointer dereference Uwe Kleine-König
2008-07-30 14:53 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).