[PATCH libdrm] freedreno: zero is a valid fd number, treat it as such

Thierry Reding thierry.reding at gmail.com
Tue Jul 14 01:14:32 PDT 2015


On Mon, Jul 13, 2015 at 02:52:09PM +0100, Emil Velikov wrote:
> Abeit quite unlikely to get hit by this bug here, let just fix it.
> 
> v2: Correct conditional (do not call ioctl(DRM_IOCTL_PRIME_HANDLE_TO_FD)
> when we already have the fd).
> 
> Cc: freedreno at lists.freedesktop.org
> Cc: Rob Clark <robdclark at gmail.com>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>  freedreno/freedreno_bo.c | 6 +++---
>  freedreno/kgsl/kgsl_bo.c | 1 +
>  freedreno/msm/msm_bo.c   | 1 +
>  3 files changed, 5 insertions(+), 3 deletions(-)

I think there's another one in kgsl_pipe_destroy(). With that fixed,
this is:

Reviewed-by: Thierry Reding <treding at nvidia.com>

There are also a couple more like this in omap_drm.c (I suspect Rob
copied from that =) that we may want to fix at the same time (in the
same patch or a separate one).

There's also a few places where an fd is compared to -1 directly, which
should be okay, but might be worth making consistent. I can send a patch
if you're not pedantic enough. =)

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150714/5e79eb48/attachment.sig>


More information about the dri-devel mailing list