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: <CABQX2QOoq3H=eHdM83_k5vgHiaMu9Zsto=H7S95QHxT-s16jEQ@mail.gmail.com>
Date: Mon, 29 Jul 2024 15:16:37 -0400
From: Zack Rusin <zack.rusin@...adcom.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>, 
	Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>, 
	Javier Martinez Canillas <javierm@...hat.com>, dri-devel@...ts.freedesktop.org, 
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] drm/plane: Fix IS_ERR() vs NULL bug

On Sat, Jul 27, 2024 at 1:32 AM Dan Carpenter <dan.carpenter@...aro.org> wrote:
>
> The drm_property_create_signed_range() function returns NULL on error,
> it doesn't return error pointers.  Change the IS_ERR() tests to check
> for NULL.
>
> Fixes: 8f7179a1027d ("drm/atomic: Add support for mouse hotspots")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
>  drivers/gpu/drm/drm_plane.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index a28b22fdd7a4..4fcb5d486de6 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -328,14 +328,14 @@ static int drm_plane_create_hotspot_properties(struct drm_plane *plane)
>
>         prop_x = drm_property_create_signed_range(plane->dev, 0, "HOTSPOT_X",
>                                                   INT_MIN, INT_MAX);
> -       if (IS_ERR(prop_x))
> -               return PTR_ERR(prop_x);
> +       if (!prop_x)
> +               return -ENOMEM;
>
>         prop_y = drm_property_create_signed_range(plane->dev, 0, "HOTSPOT_Y",
>                                                   INT_MIN, INT_MAX);
> -       if (IS_ERR(prop_y)) {
> +       if (!prop_y) {
>                 drm_property_destroy(plane->dev, prop_x);
> -               return PTR_ERR(prop_y);
> +               return -ENOMEM;
>         }
>
>         drm_object_attach_property(&plane->base, prop_x, 0);

Thanks, that looks good to me.

Reviewed-by: Zack Rusin <zack.rusin@...adcom.com>

z

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ