lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230908021913.GB3115@linuxcarl2.richtek.com>
Date:   Fri, 8 Sep 2023 10:19:13 +0800
From:   ChiaEn Wu <chiaen_wu@...htek.com>
To:     Dan Carpenter <dan.carpenter@...aro.org>
CC:     AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>,
        Sebastian Reichel <sre@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>,
        <kernel-janitors@...r.kernel.org>, <error27@...il.com>
Subject: Re: [PATCH] power: supply: mt6370: Fix missing error code in
 mt6370_chg_toggle_cfo()

On Thu, Sep 07, 2023 at 02:08:17PM +0300, Dan Carpenter wrote:

[...]

> > > diff --git a/drivers/power/supply/mt6370-charger.c b/drivers/power/supply/mt6370-charger.c
> > > index f27dae5043f5..a9641bd3d8cf 100644
> > > --- a/drivers/power/supply/mt6370-charger.c
> > > +++ b/drivers/power/supply/mt6370-charger.c
> > > @@ -324,7 +324,7 @@ static int mt6370_chg_toggle_cfo(struct mt6370_priv *priv)
> > >   	if (fl_strobe) {
> > >   		dev_err(priv->dev, "Flash led is still in strobe mode\n");
> > > -		return ret;
> > > +		return -EINVAL;
> > 
> > I think that returning 0 here was intentional, but I agree on a return ret
> > here being both confusing and wrong.
> 
> If it's a success path then probably we should remove the dev_err().
> 

Hi all,
Sorry for the late reply!

I agree with the first half of Angelo's statement, I did make the
mistake on this 'return ret'.
What I was trying to say is that you should not to toggle cfo function
when the FLED of MT6370 is still in "strobe mode".

Therefore, I think the change of Harshit's patch is correct.
It should be 'return -EINVAL' or 'return -EPERM' here.

Thanks!


Reviewed-by: ChiaEn Wu <chiaen_wu@...htek.com>


Best regards,
ChiaEn Wu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ