all: include config.h only when available and use its defines
[platform/upstream/libdrm.git] / libkms / intel.c
index a1914f8..92f1cf2 100644 (file)
@@ -26,7 +26,9 @@
  **************************************************************************/
 
 
-#define HAVE_STDINT_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #define _FILE_OFFSET_BITS 64
 
 #include <errno.h>
@@ -44,9 +46,7 @@
 struct intel_bo
 {
        struct kms_bo base;
-       unsigned handle;
        unsigned map_count;
-       int mapped;
 };
 
 static int
@@ -103,6 +103,7 @@ intel_bo_create(struct kms_driver *kms,
                pitch = (pitch + 512 - 1) & ~(512 - 1);
                size = pitch * ((height + 4 - 1) & ~(4 - 1));
        } else {
+               free(bo);
                return -EINVAL;
        }