Skip to content

Commit

Permalink
drm/radeon/radeon_fence.c: move a dereference below the NULL test
Browse files Browse the repository at this point in the history
If a NULL value is possible, the dereference should only occur after the
NULL test.

Coverity CID: 13334

Signed-off-by: Darren Jenkins <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
DarrenRJ authored and airlied committed Jan 7, 2010
1 parent d8a7f79 commit 3655d54
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/gpu/drm/radeon/radeon_fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3655d54

Please sign in to comment.