radeon: Fix compile warnings, compile errors.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 4 Apr 2009 07:33:23 +0000 (00:33 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 4 Apr 2009 07:36:05 +0000 (00:36 -0700)
src/gallium/winsys/drm/radeon/core/radeon_r300.c

index c7b6813014fcd25e0820d10d07fea6ba5bfaddf8..ce03bf2260b886934b1113f1e1d8ac6de3da0877 100644 (file)
@@ -79,10 +79,15 @@ struct r300_winsys*
 radeon_create_r300_winsys(int fd, struct radeon_winsys* old_winsys)
 {
     struct r300_winsys* winsys = CALLOC_STRUCT(r300_winsys);
+    struct radeon_cs_manager* csm;
+
+    if (winsys == NULL) {
+        return NULL;
+    }
 
     do_ioctls(winsys, fd);
 
-    struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd);
+    csm = radeon_cs_manager_gem_ctor(fd);
 
     winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4);