[PATCH] radeon: fix use-after-free in modesetting cleanup

Dave Airlie airlied at gmail.com
Tue Apr 22 20:40:22 PDT 2014


From: Dave Airlie <airlied at redhat.com>

noticed while looking at something else.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/drmmode_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index fc99128..f22f198 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -966,8 +966,8 @@ drmmode_output_destroy(xf86OutputPtr output)
 	}
 	for (i = 0; i < drmmode_output->mode_output->count_encoders; i++) {
 		drmModeFreeEncoder(drmmode_output->mode_encoders[i]);
-		free(drmmode_output->mode_encoders);
 	}
+	free(drmmode_output->mode_encoders);
 	free(drmmode_output->props);
 	drmModeFreeConnector(drmmode_output->mode_output);
 	free(drmmode_output);
-- 
1.8.5.3



More information about the xorg-driver-ati mailing list