summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyle McMartin <kyle@redhat.com>2009-05-11 23:58:57 -0400
committerChris Ball <cjb@laptop.org>2009-05-12 00:03:26 -0400
commitb172617909976c4a7d8f05191e23e4647c1a1c96 (patch)
treec2a45f3c510e7c89035fd1a96adefaa9f9b5c568 /src
parent23e62499a5ecfd9c70db00c181a4801d4898fe83 (diff)
Crasher fix: Use ExaDriverAlloc() to calloc the EXA struct.
Patch from Kyle McMartin. A recent exa/exa.c commit from Dave Airlie (02ae85c4..) added a new member to the EXA struct, and corresponding code to call it if it's non-NULL. We were using calloc with sizeof() that struct at driver-compile-time; as a result, after the ABI change the new member contained garbage, passed the EXA test for NULL, was called, and segfaulted at startup. RH bug https://bugzilla.redhat.com/show_bug.cgi?id=500086 Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'src')
-rw-r--r--src/gx_driver.c2
-rw-r--r--src/lx_driver.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gx_driver.c b/src/gx_driver.c
index 46b04f5..f842712 100644
--- a/src/gx_driver.c
+++ b/src/gx_driver.c
@@ -1250,7 +1250,7 @@ GXScreenInit(int scrnIndex, ScreenPtr pScrn, int argc, char **argv)
if (pGeode->useEXA) {
- if (!(pGeode->pExa = xnfcalloc(sizeof(ExaDriverRec), 1))) {
+ if (!(pGeode->pExa = exaDriverAlloc())) {
xf86DrvMsg(scrnIndex, X_ERROR,
"Couldn't allocate the EXA structure.\n");
pGeode->NoAccel = TRUE;
diff --git a/src/lx_driver.c b/src/lx_driver.c
index 42742fb..19e923e 100644
--- a/src/lx_driver.c
+++ b/src/lx_driver.c
@@ -842,7 +842,7 @@ LXScreenInit(int scrnIndex, ScreenPtr pScrn, int argc, char **argv)
if (!pGeode->NoAccel) {
- pGeode->pExa = xnfcalloc(sizeof(ExaDriverRec), 1);
+ pGeode->pExa = exaDriverAlloc();
if (pGeode->pExa) {