projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c0b319
)
regulator: tps65217: Fix NULL pointer dereference on probe
author
Anton Vasilyev
<vasilyev@ispras.ru>
Fri, 27 Jul 2018 13:59:29 +0000
(16:59 +0300)
committer
Mark Brown
<broonie@kernel.org>
Mon, 30 Jul 2018 08:41:04 +0000
(09:41 +0100)
There is no check that tps->strobes is allocated successfully in
tps65217_regulator_probe().
The patch adds corresponding check.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/tps65217-regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/tps65217-regulator.c
b/drivers/regulator/tps65217-regulator.c
index
fc12bad
..
d84fab6
100644
(file)
--- a/
drivers/regulator/tps65217-regulator.c
+++ b/
drivers/regulator/tps65217-regulator.c
@@
-232,6
+232,8
@@
static int tps65217_regulator_probe(struct platform_device *pdev)
tps->strobes = devm_kcalloc(&pdev->dev,
TPS65217_NUM_REGULATOR, sizeof(u8),
GFP_KERNEL);
+ if (!tps->strobes)
+ return -ENOMEM;
platform_set_drvdata(pdev, tps);