From: Jan Vesely <jan.vesely@rutgers.edu>
To: dri-devel@lists.freedesktop.org,
Ian Romanick <idr@freedesktop.org>,
Emil Velikov <emil.l.velikov@gmail.com>
Subject: [libdrm][PATCH 3/2] Fix always true comparison.
Date: Mon, 9 Feb 2015 19:10:43 -0500 [thread overview]
Message-ID: <1423527043-21264-1-git-send-email-jan.vesely@rutgers.edu> (raw)
In-Reply-To: <1423517995-28251-1-git-send-email-jan.vesely@rutgers.edu>
The only user I found is xserver, it can return -1 under certain conditions.
So check for -1 explicitly.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---
I could not find whether it's actually legal to return encoded negative values
in get_perm. This is a quick fix to detect the one case that I found.
xf86drm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xf86drm.c b/xf86drm.c
index fb673b5..8e54ac9 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -335,7 +335,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type)
drm_server_info->get_perms(&serv_group, &serv_mode);
devmode = serv_mode ? serv_mode : DRM_DEV_MODE;
devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH);
- group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
+ group = (serv_group != ~0U) ? serv_group : DRM_DEV_GID;
}
#if !defined(UDEV)
--
2.1.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-02-10 0:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 21:39 [libdrm][PATCH 1/2] random: Use unsigned long for seed Jan Vesely
2015-02-09 21:39 ` [libdrm][PATCH 2/2] Fix gcc -Wextra warnings Jan Vesely
2015-02-09 23:12 ` Ian Romanick
2015-02-09 23:32 ` Emil Velikov
2015-02-10 0:02 ` Jan Vesely
2015-02-10 0:27 ` Emil Velikov
2015-02-10 21:37 ` Jan Vesely
2015-02-10 22:55 ` Emil Velikov
2015-02-09 23:11 ` [libdrm][PATCH 1/2] random: Use unsigned long for seed Ian Romanick
2015-02-09 23:26 ` Jan Vesely
2015-02-09 23:28 ` [libdrm][PATCH v2 " Jan Vesely
2015-02-10 18:21 ` Ian Romanick
2015-02-10 0:10 ` Jan Vesely [this message]
2015-02-25 17:11 ` [libdrm][PATCH 3/2] Fix always true comparison Jan Vesely
2015-02-25 18:41 ` Emil Velikov
2015-03-02 20:01 ` Jan Vesely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423527043-21264-1-git-send-email-jan.vesely@rutgers.edu \
--to=jan.vesely@rutgers.edu \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=idr@freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).