kernel/drm: Move a NULL check to the proper place.
authorSascha Wildner <saw@online.de>
Fri, 30 Dec 2011 16:39:11 +0000 (17:39 +0100)
committerSascha Wildner <saw@online.de>
Fri, 30 Dec 2011 16:39:11 +0000 (17:39 +0100)
sys/dev/drm/radeon_cs.c

index e49830d..adc1209 100644 (file)
@@ -142,16 +142,15 @@ int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *fpriv)
        long size;
        int r, i;
 
+       if (dev_priv == NULL) {
+               DRM_ERROR("called with no initialization\n");
+               return -EINVAL;
+       }
        DRM_SPINLOCK(&dev_priv->cs.cs_mutex);
        /* set command stream id to 0 which is fake id */
        cs_id = 0;
        cs->cs_id = cs_id;
 
-       if (dev_priv == NULL) {
-               DRM_ERROR("called with no initialization\n");
-               DRM_SPINUNLOCK(&dev_priv->cs.cs_mutex);
-               return -EINVAL;
-       }
        if (!cs->num_chunks) {
                DRM_SPINUNLOCK(&dev_priv->cs.cs_mutex);
                return 0;