I moved the fence dereference after the check.  rdev is fence->rdev so I 
moved the rdev deference as well.

This was found by static analysis so I can't say whether fence is ever 
actually null but it's a good thing to do either way.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <erro...@gmail.com>

--- orig/drivers/gpu/drm/radeon/radeon_fence.c  2009-11-16 23:48:42.000000000 
+0200
+++ devel/drivers/gpu/drm/radeon/radeon_fence.c 2009-11-16 23:50:23.000000000 
+0200
@@ -140,14 +140,15 @@
 
 bool radeon_fence_signaled(struct radeon_fence *fence)
 {
-       struct radeon_device *rdev = fence->rdev;
+       struct radeon_device *rdev;
        unsigned long irq_flags;
        bool signaled = false;
 
-       if (rdev->gpu_lockup) {
+       if (fence == NULL) {
                return true;
        }
-       if (fence == NULL) {
+       rdev = fence->rdev;
+       if (rdev->gpu_lockup) {
                return true;
        }
        write_lock_irqsave(&fence->rdev->fence_drv.lock, irq_flags);

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to