power: supply: axp288_charger: Fix missing mutex_init()
Subsystems (4)
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")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wei Yongjun <[email protected]>
--- drivers/power/supply/axp288_charger.c | 1 + 1 file changed, 1 insertion(+)
drivers/power/supply/axp288_charger.c +1 -0
@@ -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;
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")Reported-by Hulk Robot <[email protected]>Signed-off-by Wei Yongjun <[email protected]>
Thanks, patch looks good to me
(I should have catched this myself during review...) :
Reviewed-by Hans de Goede <[email protected]>
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@@ -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;
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")Reported-by Hulk Robot <[email protected]>Signed-off-by Wei Yongjun <[email protected]>Thanks, patch looks good to me
(I should have catched this myself during review...) :Reviewed-by Hans de Goede <[email protected]>
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@@ -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;