Fix radeon kms compiled with clang.
Christiano F. Haesbaert
haesbaert at haesbaert.org
Sat Nov 30 08:38:32 PST 2013
This will prevent xorg from segfaulting at startup if compiled with
clang, this was observed in bitrig (openbsd fork), as well as other
systems, as it can be seen here:
https://bugs.freedesktop.org/show_bug.cgi?id=47160
This patch makes my radeon hd6770 work without problems in clang.
ps: I'm not subscribed to the list
>From c0795485027baba0b8cff90f6d30fa008265469b Mon Sep 17 00:00:00 2001
From: "Christiano F. Haesbaert" <haesbaert at haesbaert.org>
Date: Sat, 30 Nov 2013 17:33:07 +0100
Subject: [PATCH] Fix radeon kms on clang.
clang optimizations will consider this undefined behaviour due to
uninitiliazed data. Xorg was segfaulting on startup with radeonkms on
a HD6770, found out by fixing the clang warnings.
---
src/radeon_dri2.c | 2 +-
src/radeon_kms.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git src/radeon_dri2.c src/radeon_dri2.c
index 79d8f39..4498606 100644
--- src/radeon_dri2.c
+++ src/radeon_dri2.c
@@ -576,7 +576,7 @@ static void
radeon_dri2_client_state_changed(CallbackListPtr *ClientStateCallback, pointer data, pointer calldata)
{
DRI2ClientEventsPtr pClientEventsPriv;
- DRI2FrameEventPtr ref;
+ DRI2FrameEventPtr ref = NULL;
NewClientInfoRec *clientinfo = calldata;
ClientPtr pClient = clientinfo->client;
pClientEventsPriv = GetDRI2ClientEvents(pClient);
diff --git src/radeon_kms.c src/radeon_kms.c
index 44a0139..223d669 100644
--- src/radeon_kms.c
+++ src/radeon_kms.c
@@ -270,7 +270,7 @@ static void
radeon_dirty_update(ScreenPtr screen)
{
RegionPtr region;
- PixmapDirtyUpdatePtr ent;
+ PixmapDirtyUpdatePtr ent = NULL;
if (xorg_list_is_empty(&screen->pixmap_dirty_list))
return;
--
1.8.4.3
More information about the xorg-driver-ati
mailing list