radeon: fix BO null check, should be in higher level fn
authorDave Airlie <airlied@redhat.com>
Mon, 21 Dec 2009 04:59:48 +0000 (14:59 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 21 Dec 2009 04:59:48 +0000 (14:59 +1000)
radeon/radeon_bo.c
radeon/radeon_bo_gem.c

index f04a77a..eb3a1bc 100644 (file)
@@ -32,6 +32,9 @@ void radeon_bo_ref(struct radeon_bo *bo)
 struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo)
 {
     struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
+    if (bo == NULL)
+        return NULL;
+
     boi->cref--;
     return boi->bom->funcs->bo_unref(boi);
 }
index baa1d71..9bf119a 100644 (file)
@@ -127,9 +127,6 @@ static struct radeon_bo *bo_unref(struct radeon_bo_int *boi)
     struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)boi;
     struct drm_gem_close args;
 
-    if (boi == NULL) {
-        return NULL;
-    }
     if (boi->cref) {
         return (struct radeon_bo *)boi;
     }