patch from Linux kernel 2.6.5
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 83b9600..06eaf3b 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -601,7 +601,7 @@
 		DRM_ERROR( "Cannot initialize the agpgart module.\n" );
 		DRM(stub_unregister)(dev->minor);
 		DRM(takedown)( dev );
-		return -ENOMEM;
+		return -EINVAL;
 	}
 #endif
 #if __REALLY_HAVE_MTRR
diff --git a/linux/drm_drv.h b/linux/drm_drv.h
index 83b9600..06eaf3b 100644
--- a/linux/drm_drv.h
+++ b/linux/drm_drv.h
@@ -601,7 +601,7 @@
 		DRM_ERROR( "Cannot initialize the agpgart module.\n" );
 		DRM(stub_unregister)(dev->minor);
 		DRM(takedown)( dev );
-		return -ENOMEM;
+		return -EINVAL;
 	}
 #endif
 #if __REALLY_HAVE_MTRR
diff --git a/linux/gamma_context.h b/linux/gamma_context.h
index 2338cb3..df319c0 100644
--- a/linux/gamma_context.h
+++ b/linux/gamma_context.h
@@ -84,7 +84,7 @@
 	}
 
 	wake_up_interruptible(&dev->buf_writers);
-	return DRM_MIN(avail, count);;
+	return DRM_MIN(avail, count);
 }