summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_fence.c
diff options
context:
space:
mode:
authorDarren Jenkins <darrenrjenkins@gmail.com>2009-12-30 02:20:05 +0100
committerDave Airlie <airlied@redhat.com>2010-01-07 04:54:39 +0100
commit3655d54af8dd85788c3e5088387469703a0f8f12 (patch)
treef146b33a26e6c15dd5b53963bddd13b2f7356260 /drivers/gpu/drm/radeon/radeon_fence.c
parentdrm/radeon/radeon_connectors.c: add a NULL test before dereference (diff)
downloadlinux-3655d54af8dd85788c3e5088387469703a0f8f12.tar.xz
linux-3655d54af8dd85788c3e5088387469703a0f8f12.zip
drm/radeon/radeon_fence.c: move a dereference below the NULL test
If a NULL value is possible, the dereference should only occur after the NULL test. Coverity CID: 13334 Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_fence.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_fence.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 4cdd8b4f7549..8495d4e32e18 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -140,16 +140,15 @@ int radeon_fence_create(struct radeon_device *rdev, struct radeon_fence **fence)
bool radeon_fence_signaled(struct radeon_fence *fence)
{
- struct radeon_device *rdev = fence->rdev;
unsigned long irq_flags;
bool signaled = false;
- if (rdev->gpu_lockup) {
+ if (!fence)
return true;
- }
- if (fence == NULL) {
+
+ if (fence->rdev->gpu_lockup)
return true;
- }
+
write_lock_irqsave(&fence->rdev->fence_drv.lock, irq_flags);
signaled = fence->signaled;
/* if we are shuting down report all fence as signaled */