[patch] drm: fix check for end of loop

Dan Carpenter
2010-03-28T11:25:22Z

"agpmem" is never NULL here.

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

diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index e4865f9..7732268 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -77,7 +77,7 @@ static void *agp_remap(unsigned long offset, unsigned long size,
&& (agpmem->bound + (agpmem->pages << PAGE_SHIFT)) > (offset + size))
break;
- if (!agpmem)
+ if (&agpmem->head = &dev->agp->memory)
return NULL;

/*