public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon/radeon_fence.c: move a dereference below the
@ 2009-12-30  1:20 Darren Jenkins
  0 siblings, 0 replies; only message in thread
From: Darren Jenkins @ 2009-12-30  1:20 UTC (permalink / raw)
  To: David Airlie, dri-devel mailing list, Kernel Janitors
  Cc: Linux Kernel Mailing List

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>

diff --git drivers/gpu/drm/radeon/radeon_fence.c drivers/gpu/drm/radeon/radeon_fence.c
index 4cdd8b4..f3a8380 100644
--- drivers/gpu/drm/radeon/radeon_fence.c
+++ drivers/gpu/drm/radeon/radeon_fence.c
@@ -140,14 +140,14 @@ 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 = NULL) {
 		return true;
 	}
-	if (fence = NULL) {
+
+	if (fence->rdev->gpu_lockup) {
 		return true;
 	}
 	write_lock_irqsave(&fence->rdev->fence_drv.lock, irq_flags);



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-30  1:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30  1:20 [PATCH] drm/radeon/radeon_fence.c: move a dereference below the Darren Jenkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox