libdrm/radeon: Fix section size mismatch to reset the section.
authorPauli Nieminen <suokkos@gmail.com>
Mon, 1 Feb 2010 18:19:33 +0000 (20:19 +0200)
committerDave Airlie <airlied@redhat.com>
Thu, 4 Feb 2010 02:14:37 +0000 (12:14 +1000)
If there is section size mismatch reusing the section object
makes section start fail.
Reseting the object before doing error checking prevents the
possible flood of errors.

radeon/radeon_cs_gem.c

index c2301ad..45a219c 100644 (file)
@@ -260,7 +260,10 @@ static int cs_gem_end(struct radeon_cs_int *cs,
                 cs->section_file, cs->section_func, cs->section_line, cs->section_ndw, cs->section_cdw);
         fprintf(stderr, "CS section end at (%s,%s,%d)\n",
                 file, func, line);
-        return -EPIPE;
+
+       /* We must reset the section even when there is error. */
+       cs->section_ndw = 0;
+       return -EPIPE;
     }
     cs->section_ndw = 0;
     return 0;