[PATCH] fix typo for drmOpenByName

Emil Velikov emil.l.velikov at gmail.com
Thu May 14 03:55:49 PDT 2015


On 14 May 2015 at 07:17, Guo Yejun <yejun.guo at intel.com> wrote:
> Signed-off-by: Guo Yejun <yejun.guo at intel.com>
> ---
>  xf86drm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index f7c45f8..5e7306e 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -635,9 +635,8 @@ static int drmOpenByName(const char *name, int type)
>                     drmFreeVersion(version);
>                     id = drmGetBusid(fd);
>                     drmMsg("drmGetBusid returned '%s'\n", id ? id : "NULL");
> -                   if (!id || !*id) {
> -                       if (id)
> -                           drmFreeBusid(id);
> +                   if (id && *id) {
> +                       drmFreeBusid(id);
I believe that it's correct as is, at least according to the comment
just before the loop. What makes you think that it's a typo ?
Admittedly this function is not too pretty, but most of that is due to
it originating from the UMS era.

-Emil


More information about the dri-devel mailing list