From: Chao Xie Date: Mon, 19 Aug 2013 01:27:55 +0000 (-0400) Subject: mfd: 88pm805: Fix potential NULL pdata dereference X-Git-Tag: next-20130912~124^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2b274fe522e9d5ac7397e07e3516bb10e3c2ee92;p=karo-tx-linux.git mfd: 88pm805: Fix potential NULL pdata dereference User pass platform data to device, and platform data may be NULL. Add the check for pdata. Signed-off-by: Chao Xie Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/88pm805.c b/drivers/mfd/88pm805.c index 0686cdb06b3e..8a5b6ffb5afb 100644 --- a/drivers/mfd/88pm805.c +++ b/drivers/mfd/88pm805.c @@ -243,7 +243,7 @@ static int pm805_probe(struct i2c_client *client, goto err_805_init; } - if (pdata->plat_config) + if (pdata && pdata->plat_config) pdata->plat_config(chip, pdata); err_805_init: