From ad2e37773759d20aff3353c72e9db8fead283256 Mon Sep 17 00:00:00 2001 From: Ilija Hadzic Date: Thu, 20 Dec 2012 22:19:31 -0500 Subject: [PATCH] DRI2: fix a segfault in radeon_dri2_destroy_buffer2 When an error case is caught, do not assume valid pScreen pointer. This avoids a segfault in error-handling branch of the function and allows the server to log error and continue. Signed-off-by: Ilija Hadzic --- src/radeon_dri2.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index 443d908..8064206 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -353,11 +353,8 @@ radeon_dri2_destroy_buffer2(ScreenPtr pScreen, /* Trying to free an already freed buffer is unlikely to end well */ if (private->refcnt == 0) { - ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); - - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "Attempted to destroy previously destroyed buffer.\ - This is a programming error\n"); + ErrorF("Attempted to destroy previously destroyed buffer. " + "This is a programming error.\n"); return; } -- 1.7.4.1