Skip to contentSkip to conversation

drm/radeon: forever loop on error in radeon_do_test_moves()

PATCH In review Dan Carpenter 2 participants 2 messages Jul 1, 2013 – Oct 2, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: forever loop on error in radeon_do_test_moves()

The error path does this:

	for (--i; i >= 0; --i) {

which is a forever loop because "i" is unsigned.

drivers/gpu/drm/radeon/radeon_test.c +2 -2
index f4d6bce..12e8099 100644
@@ -36,8 +36,8 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag)
 	struct radeon_bo *vram_obj = NULL;
 	struct radeon_bo **gtt_obj = NULL;
 	uint64_t gtt_addr, vram_addr;
-	unsigned i, n, size;
-	int r, ring;
+	unsigned n, size;
+	int i, r, ring;
 
 	switch (flag) {
 	case RADEON_TEST_COPY_DMA:
#1 lore raw
Quoted 7 lines · Dan Carpenter

The error path does this:

        for (--i; i >= 0; --i) {

which is a forever loop because "i" is unsigned.

Sorry I missed this one. Applied.

Thanks!

Alex

Quoted 20 lines
drivers/gpu/drm/radeon/radeon_test.c +2 -2
index f4d6bce..12e8099 100644
@@ -36,8 +36,8 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag)
        struct radeon_bo *vram_obj = NULL;
        struct radeon_bo **gtt_obj = NULL;
        uint64_t gtt_addr, vram_addr;
-       unsigned i, n, size;
-       int r, ring;
+       unsigned n, size;
+       int i, r, ring;
 
        switch (flag) {
        case RADEON_TEST_COPY_DMA:

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel