From 5502757afe919179c8dc32da3758c802803f1fdd Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Tue, 30 Sep 2008 21:42:45 +0300 Subject: [PATCH] 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: Felipe Balbi Signed-off-by: Tony Lindgren --- drivers/input/keyboard/omap-twl4030keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/omap-twl4030keypad.c b/drivers/input/keyboard/omap-twl4030keypad.c index 3893d633071..48f29d3f9fd 100644 --- a/drivers/input/keyboard/omap-twl4030keypad.c +++ b/drivers/input/keyboard/omap-twl4030keypad.c @@ -238,7 +238,7 @@ static int __init omap_kp_probe(struct platform_device *pdev) return -ENOMEM; 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); return -EINVAL; } -- 2.41.1