[libdrm][PATCH 3/2] Fix always true comparison.
Jan Vesely
jan.vesely at rutgers.edu
Wed Feb 25 09:11:40 PST 2015
gentle ping
On Mon, 2015-02-09 at 19:10 -0500, Jan Vesely wrote:
> 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 at 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)
--
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150225/90cbc774/attachment-0001.sig>
More information about the dri-devel
mailing list