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] [day] [month] [year] [list]
Date:   Tue, 19 Sep 2023 13:26:30 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Chen-Yu Tsai <wenst@...omium.org>
Cc:     Matthias Brugger <matthias.bgg@...il.com>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Zhiyong Tao <zhiyong.tao@...iatek.com>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] regulator: mt6358: return error for get/set mode op on
 linear range LDO

On Tue, Sep 19, 2023 at 04:36:46PM +0800, Chen-Yu Tsai wrote:
> The buck and linear range (VSRAM_*) regulators share one set of ops.
> This set includes support for get/set mode. However this only makes
> sense for buck regulators, not LDOs. The callbacks were not checking
> whether the register offset and/or mask for mode setting was valid or
> not. This ends up making the kernel report "normal" mode operation for
> the LDOs.
> 
> Instead, make the callbacks return -EINVAL if the mode register mask is
> not set, signaling that it is not supported.

It would be better to use separate ops for the two cases, that way the
core knows that the operations aren't supported and can handle things
better.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ