Skip to content

Commit

Permalink
mfd: 88pm805: Fix potential NULL pdata dereference
Browse files Browse the repository at this point in the history
User pass platform data to device, and platform data may be
NULL. Add the check for pdata.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Chao Xie authored and Samuel Ortiz committed Sep 2, 2013
1 parent b432fc2 commit 2b274fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mfd/88pm805.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2b274fe

Please sign in to comment.