Commit 5502757a authored by Felipe Balbi's avatar Felipe Balbi Committed by Tony Lindgren

twl4030: fix potential null pointer dereference

The following patch fix a potential null pointer
dereference in twl4030 keypad driver when parts
of keypad platform_data aren't passed down to the
driver. At that point kp->dbg_dev is not set yet.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 81d2c7d8
...@@ -238,7 +238,7 @@ static int __init omap_kp_probe(struct platform_device *pdev) ...@@ -238,7 +238,7 @@ static int __init omap_kp_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
if (!pdata->rows || !pdata->cols || !pdata->keymap) { if (!pdata->rows || !pdata->cols || !pdata->keymap) {
dev_err(kp->dbg_dev, "No rows, cols or keymap from pdata\n"); dev_err(&pdev->dev, "No rows, cols or keymap from pdata\n");
kfree(kp); kfree(kp);
return -EINVAL; return -EINVAL;
} }
......
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