[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADnq5_OZrGAwYdKdOH_drjoeTHH1RK8Esv2dZd-GKW+KaEh_aw@mail.gmail.com>
Date: Fri, 21 Oct 2016 13:24:53 -0400
From: Alex Deucher <alexdeucher@...il.com>
To: Eric Anholt <eric@...olt.net>
Cc: Maling list - DRI developers <dri-devel@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH libdrm 1/2] Return an -ENODEV from drmGetDevice() when no
device was found.
On Fri, Oct 21, 2016 at 1:12 PM, Eric Anholt <eric@...olt.net> wrote:
> From: Rob Herring <robh@...nel.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@...olt.net>
Reviewed-by: Alex Deucher <alexander.deucher@....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@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Powered by blists - more mailing lists