* [PATCH] regulator: max77693: Fix use of uninitialized regulator config
@ 2014-11-03 14:07 Krzysztof Kozlowski
2014-11-03 14:36 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2014-11-03 14:07 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, linux-kernel; +Cc: Krzysztof Kozlowski, stable
Driver allocated on stack struct regulator_config but didn't initialize
it fully. Few fields (driver_data, ena_gpio) were left untouched. This
lead to using random ena_gpio values as GPIOs for max77693 regulators.
On occasion these values could match real GPIO numbers leading to
interfering with other drivers and to unsuccessful enable/disable of
regulator.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: 80b022e29bfd ("regulator: max77693: Add max77693 regualtor driver.")
Cc: <stable@vger.kernel.org>
---
drivers/regulator/max77693.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/max77693.c b/drivers/regulator/max77693.c
index 177dd9d2ce67..7b9755a6c3b5 100644
--- a/drivers/regulator/max77693.c
+++ b/drivers/regulator/max77693.c
@@ -227,7 +227,7 @@ static int max77693_pmic_probe(struct platform_device *pdev)
struct max77693_dev *iodev = dev_get_drvdata(pdev->dev.parent);
struct max77693_regulator_data *rdata = NULL;
int num_rdata, i;
- struct regulator_config config;
+ struct regulator_config config = { };
num_rdata = max77693_pmic_init_rdata(&pdev->dev, &rdata);
if (!rdata || num_rdata <= 0) {
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: max77693: Fix use of uninitialized regulator config
2014-11-03 14:07 [PATCH] regulator: max77693: Fix use of uninitialized regulator config Krzysztof Kozlowski
@ 2014-11-03 14:36 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-11-03 14:36 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Liam Girdwood, linux-kernel, stable
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
On Mon, Nov 03, 2014 at 03:07:05PM +0100, Krzysztof Kozlowski wrote:
> Driver allocated on stack struct regulator_config but didn't initialize
> it fully. Few fields (driver_data, ena_gpio) were left untouched. This
> lead to using random ena_gpio values as GPIOs for max77693 regulators.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-03 14:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-03 14:07 [PATCH] regulator: max77693: Fix use of uninitialized regulator config Krzysztof Kozlowski
2014-11-03 14:36 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).