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, 5 May 2020 10:50:08 -0400
From:   Alex Deucher <alexdeucher@...il.com>
To:     ChenTao <chentao107@...wei.com>
Cc:     Dave Airlie <airlied@...ux.ie>, Daniel Vetter <daniel@...ll.ch>,
        LKML <linux-kernel@...r.kernel.org>,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        "Deucher, Alexander" <alexander.deucher@....com>,
        Christian Koenig <christian.koenig@....com>
Subject: Re: [PATCH -next] drm/radeon: fix unsigned comparison with 0

On Tue, May 5, 2020 at 2:59 AM ChenTao <chentao107@...wei.com> wrote:
>
> Fixes warning because pipe is unsigned long and can never be negtative
>
> vers/gpu/drm/radeon/radeon_kms.c:831:11: warning:
> comparison of unsigned expression < 0 is always false [-Wtype-limits]
>   if (pipe < 0 || pipe >= rdev->num_crtc) {
> drivers/gpu/drm/radeon/radeon_kms.c:857:11: warning:
> comparison of unsigned expression < 0 is always false [-Wtype-limits]
>   if (pipe < 0 || pipe >= rdev->num_crtc) {
>
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: ChenTao <chentao107@...wei.com>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_kms.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
> index 372962358a18..c5d1dc9618a4 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -828,7 +828,7 @@ int radeon_enable_vblank_kms(struct drm_crtc *crtc)
>         unsigned long irqflags;
>         int r;
>
> -       if (pipe < 0 || pipe >= rdev->num_crtc) {
> +       if (pipe >= rdev->num_crtc) {
>                 DRM_ERROR("Invalid crtc %d\n", pipe);
>                 return -EINVAL;
>         }
> @@ -854,7 +854,7 @@ void radeon_disable_vblank_kms(struct drm_crtc *crtc)
>         struct radeon_device *rdev = dev->dev_private;
>         unsigned long irqflags;
>
> -       if (pipe < 0 || pipe >= rdev->num_crtc) {
> +       if (pipe >= rdev->num_crtc) {
>                 DRM_ERROR("Invalid crtc %d\n", pipe);
>                 return;
>         }
> --
> 2.22.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Powered by blists - more mailing lists