From 6de39fc73050a386a39c53e522098a0a784e7ff8 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 21 Dec 2009 14:59:48 +1000 Subject: [PATCH] radeon: fix BO null check, should be in higher level fn --- radeon/radeon_bo.c | 3 +++ radeon/radeon_bo_gem.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/radeon/radeon_bo.c b/radeon/radeon_bo.c index f04a77a1..eb3a1bc8 100644 --- a/radeon/radeon_bo.c +++ b/radeon/radeon_bo.c @@ -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); } diff --git a/radeon/radeon_bo_gem.c b/radeon/radeon_bo_gem.c index baa1d716..9bf119a6 100644 --- a/radeon/radeon_bo_gem.c +++ b/radeon/radeon_bo_gem.c @@ -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; }