From: Pauli Nieminen Date: Mon, 1 Feb 2010 18:19:33 +0000 (+0200) Subject: libdrm/radeon: Fix section size mismatch to reset the section. X-Git-Tag: submit/1.0/20121108.012404~306 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1802e1a4e747b5906d3af10c4a53fd457eddcbb4;p=profile%2Fivi%2Flibdrm.git 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. --- diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c index c2301ad..45a219c 100644 --- a/radeon/radeon_cs_gem.c +++ b/radeon/radeon_cs_gem.c @@ -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;