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: <09e28d31-881f-acd0-33d0-565bdc9475ae@kapsi.fi>
Date:   Mon, 27 Sep 2021 11:52:48 +0300
From:   Mikko Perttunen <cyndis@...si.fi>
To:     Yang Yingliang <yangyingliang@...wei.com>,
        linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org
Cc:     krzysztof.kozlowski@...onical.com, mperttunen@...dia.com
Subject: Re: [PATCH -next] memory: tegra186-emc: Fix error return code in
 tegra186_emc_probe()

On 9/27/21 10:51 AM, Yang Yingliang wrote:
> Return the error code when command fails.
> 
> Fixes: 13324edbe926 ("memory: tegra186-emc: Handle errors in BPMP response")
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
> ---
>   drivers/memory/tegra/tegra186-emc.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/memory/tegra/tegra186-emc.c b/drivers/memory/tegra/tegra186-emc.c
> index abc0c2eeaab7..16351840b187 100644
> --- a/drivers/memory/tegra/tegra186-emc.c
> +++ b/drivers/memory/tegra/tegra186-emc.c
> @@ -198,6 +198,7 @@ static int tegra186_emc_probe(struct platform_device *pdev)
>   		goto put_bpmp;
>   	}
>   	if (msg.rx.ret < 0) {
> +		err = msg.rx.ret;
>   		dev_err(&pdev->dev, "EMC DVFS MRQ failed: %d (BPMP error code)\n", msg.rx.ret);
>   		goto put_bpmp;
>   	}
> 

Good catch, but we shouldn't return msg.rx.ret since it is a BPMP error 
code that doesn't necessarily map directly to a Linux error code. So we 
should set err to something like -EINVAL instead. Please update, or if 
you'd prefer, I can fix it.

Mikko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ