aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-08-30 14:30:48 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-08-30 14:55:47 -0400
commit903b9124eae00edf8a9d6491dab60fcda777aabd (patch)
treef7c3b509d24ff30457ee75bd40a5ed58ebfeb771
parent9d8340687c524ce61e3c9c76758c4c81303acfc0 (diff)
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: Julia Lawall <julia@diku.dk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/keyboard/w90p910_keypad.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c
index 2d03dd0f9e07..6032def03707 100644
--- a/drivers/input/keyboard/w90p910_keypad.c
+++ b/drivers/input/keyboard/w90p910_keypad.c
@@ -120,7 +120,7 @@ static int __devinit w90p910_keypad_probe(struct platform_device *pdev)
120{ 120{
121 const struct w90p910_keypad_platform_data *pdata = 121 const struct w90p910_keypad_platform_data *pdata =
122 pdev->dev.platform_data; 122 pdev->dev.platform_data;
123 const struct matrix_keymap_data *keymap_data = pdata->keymap_data; 123 const struct matrix_keymap_data *keymap_data;
124 struct w90p910_keypad *keypad; 124 struct w90p910_keypad *keypad;
125 struct input_dev *input_dev; 125 struct input_dev *input_dev;
126 struct resource *res; 126 struct resource *res;
@@ -132,6 +132,8 @@ static int __devinit w90p910_keypad_probe(struct platform_device *pdev)
132 return -EINVAL; 132 return -EINVAL;
133 } 133 }
134 134
135 keymap_data = pdata->keymap_data;
136
135 irq = platform_get_irq(pdev, 0); 137 irq = platform_get_irq(pdev, 0);
136 if (irq < 0) { 138 if (irq < 0) {
137 dev_err(&pdev->dev, "failed to get keypad irq\n"); 139 dev_err(&pdev->dev, "failed to get keypad irq\n");