Archived
14
0
Fork 0

Input: twl4030_keypad - avoid potential NULL-pointer dereference

Signed-off-by: Shubhrajyoti D <a0393217@india.ti.com>
Acked-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Shubhrajyoti D 2011-04-06 15:31:22 -07:00 committed by Dmitry Torokhov
parent e28e1d93e9
commit 8f74c0661c

View file

@ -338,7 +338,7 @@ static int __devinit twl4030_kp_probe(struct platform_device *pdev)
u8 reg;
int error;
if (!pdata || !pdata->rows || !pdata->cols ||
if (!pdata || !pdata->rows || !pdata->cols || !pdata->keymap_data ||
pdata->rows > TWL4030_MAX_ROWS || pdata->cols > TWL4030_MAX_COLS) {
dev_err(&pdev->dev, "Invalid platform_data\n");
return -EINVAL;