libdrm/radeon: Fix section size mismatch to reset the section.

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.
main
Pauli Nieminen 2010-02-01 20:19:33 +02:00 committed by Dave Airlie
parent 520c658706
commit 1802e1a4e7
1 changed files with 4 additions and 1 deletions

View 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;