projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
24d479d
)
regulator: fp9931: Add missing memory allocation check
author
Felix Gu
<gu_0233@qq.com>
Sun, 18 Jan 2026 09:26:23 +0000
(17:26 +0800)
committer
Mark Brown
<broonie@kernel.org>
Mon, 19 Jan 2026 14:42:02 +0000
(14:42 +0000)
Add a check for devm_kzalloc failure in fp9931_probe to prevent a
null pointer dereference.
Fixes:
12d821bd13d4
("regulator: Add FP9931/JD9930 driver")
Signed-off-by: Felix Gu <gu_0233@qq.com>
Link:
https://patch.msgid.link/tencent_5FCF2108621C51007E5526A7C60A5CC1F306@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/fp9931.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/fp9931.c
b/drivers/regulator/fp9931.c
index
69b3c71
..
7fbcc63
100644
(file)
--- a/
drivers/regulator/fp9931.c
+++ b/
drivers/regulator/fp9931.c
@@
-439,6
+439,9
@@
static int fp9931_probe(struct i2c_client *client)
int i;
data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
data->regmap = devm_regmap_init_i2c(client, ®map_config);
if (IS_ERR(data->regmap))
return dev_err_probe(&client->dev, PTR_ERR(data->regmap),