radeon/winsys: fix get info ioctl error checking
authorJerome Glisse <jglisse@redhat.com>
Mon, 9 Jan 2012 19:59:56 +0000 (14:59 -0500)
committerJerome Glisse <jglisse@redhat.com>
Mon, 9 Jan 2012 19:59:56 +0000 (14:59 -0500)
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

index 442bd2acd140a76f1974474f6a369da6c4a5b8cf..f337411e2237f90da3ae9ffb88b2e804fd709d29 100644 (file)
@@ -138,9 +138,11 @@ static boolean radeon_get_drm_value(int fd, unsigned request,
     info.request = request;
 
     retval = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info));
-    if (retval && errname) {
-        fprintf(stderr, "radeon: Failed to get %s, error number %d\n",
-                errname, retval);
+    if (retval) {
+        if (errname) {
+            fprintf(stderr, "radeon: Failed to get %s, error number %d\n",
+                    errname, retval);
+        }
         return FALSE;
     }
     return TRUE;