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]
Message-ID: <CADnq5_Os1fKouKSkfmmiWgjLxkX3FQ1Ny5Wcno7VQcheG4-26Q@mail.gmail.com>
Date:   Mon, 24 May 2021 14:12:06 -0400
From:   Alex Deucher <alexdeucher@...il.com>
To:     Wei Yongjun <weiyongjun1@...wei.com>
Cc:     Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Prike Liang <Prike.Liang@....com>,
        Lijo Lazar <lijo.lazar@....com>,
        Rajneesh Bhardwaj <rajneesh.bhardwaj@....com>,
        Ye Bin <yebin10@...wei.com>, Likun Gao <Likun.Gao@....com>,
        "Fabio M. De Francesco" <fmdefrancesco@...il.com>,
        Hulk Robot <hulkci@...wei.com>,
        kernel-janitors@...r.kernel.org,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()

On Mon, May 24, 2021 at 9:25 AM Wei Yongjun <weiyongjun1@...wei.com> wrote:
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.

I don't see any other cases in this function where we return an error.
It could arguably be made a void.  All of these APCI methods are
optional.

Alex

>
> Fixes: 77bf762f8b30 ("drm/amdgpu/acpi: unify ATCS handling (v3)")
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 49563ff87f1a..9564690b21b4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -895,12 +895,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
>  atcs:
>         /* Probe for ATCS, and initialize it if found */
>         atcs_handle = amdgpu_atcs_probe_handle(handle);
> -       if (!atcs_handle)
> +       if (!atcs_handle) {
> +               ret = -ENODEV;
>                 goto out;
> +       }
>
>         atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
>         if (!atcs) {
>                 DRM_WARN("Not enough memory to initialize ATCS\n");
> +               ret = -ENOMEM;
>                 goto out;
>         }
>         atcs->handle = atcs_handle;
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ