Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1506158 > unrolled thread

[PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found.

Started byEric Anholt <eric@anholt.net>
First post2016-10-21 19:20 +0200
Last post2016-10-21 19:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found. Eric Anholt <eric@anholt.net> - 2016-10-21 19:20 +0200
    Re: [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no  device was found. Alex Deucher <alexdeucher@gmail.com> - 2016-10-21 19:30 +0200
    Re: [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no  device was found. Emil Velikov <emil.l.velikov@gmail.com> - 2016-10-21 19:40 +0200

#1506158 — [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found.

FromEric Anholt <eric@anholt.net>
Date2016-10-21 19:20 +0200
Subject[PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found.
Message-ID<suLE6-dO-9@gated-at.bofh.it>
From: Rob Herring <robh@kernel.org>

Fixes crashes in Mesa on platform device, which expected *device to
have a device when 0 was returned.

(code from a paste by Rob, commit message by anholt)

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 xf86drm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xf86drm.c b/xf86drm.c
index 9cfca49ddfda..9b52889e4cef 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
 
     closedir(sysdir);
     free(local_devices);
+    if (*device == NULL)
+	return -ENODEV;
     return 0;
 
 free_devices:
-- 
2.9.3

[toc] | [next] | [standalone]


#1506167 — Re: [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found.

FromAlex Deucher <alexdeucher@gmail.com>
Date2016-10-21 19:30 +0200
SubjectRe: [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found.
Message-ID<suLNL-hj-25@gated-at.bofh.it>
In reply to#1506158
On Fri, Oct 21, 2016 at 1:12 PM, Eric Anholt <eric@anholt.net> wrote:
> From: Rob Herring <robh@kernel.org>
>
> Fixes crashes in Mesa on platform device, which expected *device to
> have a device when 0 was returned.
>
> (code from a paste by Rob, commit message by anholt)
>
> Signed-off-by: Eric Anholt <eric@anholt.net>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  xf86drm.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index 9cfca49ddfda..9b52889e4cef 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
>
>      closedir(sysdir);
>      free(local_devices);
> +    if (*device == NULL)
> +       return -ENODEV;
>      return 0;
>
>  free_devices:
> --
> 2.9.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

[toc] | [prev] | [next] | [standalone]


#1506172 — Re: [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found.

FromEmil Velikov <emil.l.velikov@gmail.com>
Date2016-10-21 19:40 +0200
SubjectRe: [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no device was found.
Message-ID<suLXs-kW-19@gated-at.bofh.it>
In reply to#1506158
On 21 October 2016 at 18:12, Eric Anholt <eric@anholt.net> wrote:
> From: Rob Herring <robh@kernel.org>
>
> Fixes crashes in Mesa on platform device, which expected *device to
> have a device when 0 was returned.
>
> (code from a paste by Rob, commit message by anholt)
>
> Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

Thanks
Emil

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web