From: Uwe Kleine-König Date: Wed, 30 Jul 2008 14:33:43 +0000 (-0400) Subject: Input: gpio-keys - fix possible NULL pointer dereference X-Git-Tag: v2.6.27-rc4~67^2~9 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=74dd4393445ba37b79041d92de6ff7e7b68a4aec;p=linux-2.6-omap-h63xx.git Input: gpio-keys - fix possible NULL pointer dereference 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index be58730e636..1a92f4b04c1 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);