All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] power: supply: axp288_charger: Fix missing mutex_init()
@ 2021-10-13  9:31 Wei Yongjun
  2021-10-13 11:49 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2021-10-13  9:31 UTC (permalink / raw)
  To: weiyongjun1, Kate Hsuan, Sebastian Reichel, Chen-Yu Tsai, Hans de Goede
  Cc: linux-pm, kernel-janitors, Hulk Robot

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 <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 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;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] power: supply: axp288_charger: Fix missing mutex_init()
  2021-10-13  9:31 [PATCH -next] power: supply: axp288_charger: Fix missing mutex_init() Wei Yongjun
@ 2021-10-13 11:49 ` Hans de Goede
  2021-10-13 13:33   ` Sebastian Reichel
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2021-10-13 11:49 UTC (permalink / raw)
  To: Wei Yongjun, Kate Hsuan, Sebastian Reichel, Chen-Yu Tsai
  Cc: linux-pm, kernel-janitors, Hulk Robot

Hi,

On 10/13/21 11:31 AM, Wei Yongjun wrote:
> 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 <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

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

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
>  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;
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] power: supply: axp288_charger: Fix missing mutex_init()
  2021-10-13 11:49 ` Hans de Goede
@ 2021-10-13 13:33   ` Sebastian Reichel
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2021-10-13 13:33 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Wei Yongjun, Kate Hsuan, Chen-Yu Tsai, linux-pm, kernel-janitors,
	Hulk Robot

[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]

Hi,

On Wed, Oct 13, 2021 at 01:49:19PM +0200, Hans de Goede wrote:
> On 10/13/21 11:31 AM, Wei Yongjun wrote:
> > 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 <hulkci@huawei.com>
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Thanks, patch looks good to me
> (I should have catched this myself during review...) :
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Thanks, queued.

-- Sebastian

> > ---
> >  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;
> > 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-13 13:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  9:31 [PATCH -next] power: supply: axp288_charger: Fix missing mutex_init() Wei Yongjun
2021-10-13 11:49 ` Hans de Goede
2021-10-13 13:33   ` Sebastian Reichel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.