Thread (3 messages) 3 messages, 3 authors, 2021-10-13
STALE1704d

[PATCH -next] power: supply: axp288_charger: Fix missing mutex_init()

From: Wei Yongjun <hidden>
Date: 2021-10-13 09:17:42
Also in: kernel-janitors
Subsystem: power supply class/subsystem and drivers, the rest · Maintainers: Sebastian Reichel, Linus Torvalds

The driver allocates the mutex but not initialize it.
Use mutex_init() on it to initialize it correctly.

Fixes: ed229454856e ("power: supply: axp288-charger: Optimize register reading method")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
 drivers/power/supply/axp288_charger.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c
index fd4983c98fd9..9987b1731e38 100644
--- a/drivers/power/supply/axp288_charger.c
+++ b/drivers/power/supply/axp288_charger.c
@@ -865,6 +865,7 @@ static int axp288_charger_probe(struct platform_device *pdev)
 	if (!info)
 		return -ENOMEM;
 
+	mutex_init(&info->lock);
 	info->pdev = pdev;
 	info->regmap = axp20x->regmap;
 	info->regmap_irqc = axp20x->regmap_irqc;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help