From: Felipe Balbi Date: Tue, 30 Sep 2008 18:42:45 +0000 (+0300) Subject: twl4030: fix potential null pointer dereference X-Git-Tag: v2.6.27-omap1~125 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=5502757afe919179c8dc32da3758c802803f1fdd;p=linux-2.6-omap-h63xx.git 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 --- 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; }