From 1802e1a4e747b5906d3af10c4a53fd457eddcbb4 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Mon, 1 Feb 2010 20:19:33 +0200 Subject: 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. --- radeon/radeon_cs_gem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c index c2301ad3..45a219c3 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; -- cgit v1.2.3