projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe23053
)
regulator: fan53555: Fix null pointer dereference
author
Axel Lin
<
[email protected]
>
Thu, 18 Sep 2014 13:49:38 +0000
(21:49 +0800)
committer
Mark Brown
<
[email protected]
>
Thu, 18 Sep 2014 18:01:10 +0000
(11:01 -0700)
Set di->regulator before dereference it.
Signed-off-by: Axel Lin <
[email protected]
>
Reviewed-by: Heiko Stuebner <
[email protected]
>
Signed-off-by: Mark Brown <
[email protected]
>
drivers/regulator/fan53555.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/fan53555.c
b/drivers/regulator/fan53555.c
index 0168106b2cf7a4c60f550cc8889c8b7a83af6965..f8e4257aef923d16f32f969e3e74e2e1fb55c6ff 100644
(file)
--- a/
drivers/regulator/fan53555.c
+++ b/
drivers/regulator/fan53555.c
@@
-361,6
+361,7
@@
static int fan53555_regulator_probe(struct i2c_client *client,
if (!di)
return -ENOMEM;
+ di->regulator = pdata->regulator;
if (client->dev.of_node) {
const struct of_device_id *match;
@@
-389,7
+390,6
@@
static int fan53555_regulator_probe(struct i2c_client *client,
return PTR_ERR(di->regmap);
}
di->dev = &client->dev;
- di->regulator = pdata->regulator;
i2c_set_clientdata(client, di);
/* Get chip ID */
ret = regmap_read(di->regmap, FAN53555_ID1, &val);