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: <CAPDyKFphNdR-TorULpbsMtM6MzqsaK_UdSmG9Hin=wunUwJwJQ@mail.gmail.com>
Date:   Wed, 30 Nov 2022 11:04:27 +0100
From:   Ulf Hansson <ulf.hansson@...aro.org>
To:     Zhen Lei <thunder.leizhen@...wei.com>
Cc:     linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mmc: core: Fix error return code in sd_read_ext_regs()

On Wed, 30 Nov 2022 at 10:29, Zhen Lei <thunder.leizhen@...wei.com> wrote:
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Fixes: c784f92769ae ("mmc: core: Read the SD function extension registers for power management")
> Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
> ---
>  drivers/mmc/core/sd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
> index 3662bf5320ce56d..7b64f76f0179ca8 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -1277,6 +1277,7 @@ static int sd_read_ext_regs(struct mmc_card *card)
>         if (rev != 0 || len > 512) {
>                 pr_warn("%s: non-supported SD ext reg layout\n",
>                         mmc_hostname(card->host));
> +               err = -EOPNOTSUPP;

The original intent was to not return an error code. Simply, because
the card remains functional and all but the new features from the SD
function extensions registers can still be used.

Perhaps, we should update the comment a few lines above to better
reflect that this is in-fact what we intend here.

>                 goto out;
>         }
>

Kind regards
Uffe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ