Commit 903b9124 authored by Julia Lawall's avatar Julia Lawall Committed by Dmitry Torokhov

Input: w90p910_keypad - move a dereference below a NULL test

We should first check whether platform data is NULL or not, before
dereferencing it to get the keymap.
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 9d834068
...@@ -120,7 +120,7 @@ static int __devinit w90p910_keypad_probe(struct platform_device *pdev) ...@@ -120,7 +120,7 @@ static int __devinit w90p910_keypad_probe(struct platform_device *pdev)
{ {
const struct w90p910_keypad_platform_data *pdata = const struct w90p910_keypad_platform_data *pdata =
pdev->dev.platform_data; pdev->dev.platform_data;
const struct matrix_keymap_data *keymap_data = pdata->keymap_data; const struct matrix_keymap_data *keymap_data;
struct w90p910_keypad *keypad; struct w90p910_keypad *keypad;
struct input_dev *input_dev; struct input_dev *input_dev;
struct resource *res; struct resource *res;
...@@ -132,6 +132,8 @@ static int __devinit w90p910_keypad_probe(struct platform_device *pdev) ...@@ -132,6 +132,8 @@ static int __devinit w90p910_keypad_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
keymap_data = pdata->keymap_data;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(&pdev->dev, "failed to get keypad irq\n"); dev_err(&pdev->dev, "failed to get keypad irq\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment