[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20180730110454.2E86B1124216@debutante.sirena.org.uk>
Date: Mon, 30 Jul 2018 12:04:54 +0100 (BST)
From: Mark Brown <broonie@...nel.org>
To: Anton Vasilyev <vasilyev@...ras.ru>
Cc: Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org
Subject: Applied "regulator: tps65217: Fix NULL pointer dereference on probe" to the regulator tree
The patch
regulator: tps65217: Fix NULL pointer dereference on probe
has been applied to the regulator tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 4f919ca2bf6da826ba1a4316e1b8e9c94e5dbeb2 Mon Sep 17 00:00:00 2001
From: Anton Vasilyev <vasilyev@...ras.ru>
Date: Fri, 27 Jul 2018 16:59:29 +0300
Subject: [PATCH] regulator: tps65217: Fix NULL pointer dereference on probe
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@...ras.ru>
Signed-off-by: Mark Brown <broonie@...nel.org>
---
drivers/regulator/tps65217-regulator.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c
index fc12badf3805..d84fab616abf 100644
--- 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);
--
2.18.0
Powered by blists - more mailing lists