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, 27 Jul 2021 14:16:54 -0400
From:   Felix Kuehling <felix.kuehling@....com>
To:     Cai Huoqing <caihuoqing@...du.com>, alexander.deucher@....com,
        christian.koenig@....com, Xinhui.Pan@....com, airlied@...ux.ie,
        daniel@...ll.ch
Cc:     amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amdkfd: move PTR_ERR under IS_ERR() condition

Hi Huoqing,

Your patch is technically correct. However, I don't think it fixes any
actual bug, and it changes a code path that has no performance
implications. Therefore I would just leave it as it is.

Regards,
  Felix


Am 2021-07-20 um 2:34 a.m. schrieb Cai Huoqing:
> no need to get error code when IS_ERR is false
>
> Signed-off-by: Cai Huoqing <caihuoqing@...du.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index e48acdd03c1a..710659b3c1f0 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -72,16 +72,18 @@ int kfd_chardev_init(void)
>                 goto err_register_chrdev;
>
>         kfd_class = class_create(THIS_MODULE, kfd_dev_name);
> -       err = PTR_ERR(kfd_class);
> -       if (IS_ERR(kfd_class))
> +       if (IS_ERR(kfd_class)) {
> +               err = PTR_ERR(kfd_class);
>                 goto err_class_create;
> +       }
>
>         kfd_device = device_create(kfd_class, NULL,
>                                         MKDEV(kfd_char_dev_major, 0),
>                                         NULL, kfd_dev_name);
> -       err = PTR_ERR(kfd_device);
> -       if (IS_ERR(kfd_device))
> +       if (IS_ERR(kfd_device)) {
> +               err = PTR_ERR(kfd_device);
>                 goto err_device_create;
> +       }
>
>         return 0;
>
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ