Skip to contentSkip to conversation

power: supply: axp288_charger: Fix missing mutex_init()

PATCH In review Wei Yongjun 3 participants 3 messages Oct 13, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: axp288_charger: Fix missing mutex_init()

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")
---
 drivers/power/supply/axp288_charger.c | 1 +
 1 file changed, 1 insertion(+)
drivers/power/supply/axp288_charger.c +1 -0
index fd4983c98fd9..9987b1731e38 100644
@@ -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;
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 6 lines · Wei Yongjun

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")

Thanks, patch looks good to me
(I should have catched this myself during review...) :

Regards,

Hans

Quoted 17 lines
---
 drivers/power/supply/axp288_charger.c | 1 +
 1 file changed, 1 insertion(+)
drivers/power/supply/axp288_charger.c +1 -0
index fd4983c98fd9..9987b1731e38 100644
@@ -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;
#2 lore raw

Hi,

Quoted 4 lines · Hans de Goede
Quoted 3 lines · Wei Yongjun

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

Quoted 8 lines
Quoted 3 lines
Fixes ed229454856e ("power: supply: axp288-charger: Optimize register reading method")

Thanks, patch looks good to me
(I should have catched this myself during review...) :

Thanks, queued.

-- Sebastian

Quoted 18 lines
Quoted 17 lines
---
 drivers/power/supply/axp288_charger.c | 1 +
 1 file changed, 1 insertion(+)
drivers/power/supply/axp288_charger.c +1 -0
index fd4983c98fd9..9987b1731e38 100644
@@ -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;