summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-02-15 11:58:52 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-02-15 11:58:52 +1000
commit88517ced1fa2e621be2d05a319b522b3111da516 (patch)
tree570fecb360df833ae7c1e5eb31dc3a33ed1ebf49 /hw/xfree86/common
parent82425c66e7a8c436b5be7ad44880dd4be6c1f06a (diff)
parent73974dd7ea9ca4d4cdd5464cb813088a6ee9770b (diff)
Merge branch 'master' of git+ssh://people.freedesktop.org/~alanc/xserver into next
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r--hw/xfree86/common/xf86Mode.c17
-rw-r--r--hw/xfree86/common/xf86Option.c2
-rw-r--r--hw/xfree86/common/xf86fbman.c12
-rw-r--r--hw/xfree86/common/xf86xvmc.c4
4 files changed, 18 insertions, 17 deletions
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index d80dec892..706ab64fc 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1370,7 +1370,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
int saveType;
PixmapFormatRec *BankFormat;
ClockRangePtr cp;
- ClockRangePtr storeClockRanges;
int numTimings = 0;
range hsync[MAX_HSYNC];
range vrefresh[MAX_VREFRESH];
@@ -1492,16 +1491,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
/*
* Store the clockRanges for later use by the VidMode extension.
*/
- storeClockRanges = scrp->clockRanges;
- while (storeClockRanges != NULL) {
- storeClockRanges = storeClockRanges->next;
- }
- for (cp = clockRanges; cp != NULL; cp = cp->next,
- storeClockRanges = storeClockRanges->next) {
- storeClockRanges = xnfalloc(sizeof(ClockRange));
+ nt_list_for_each_entry(cp, clockRanges, next) {
+ ClockRangePtr newCR = xnfalloc(sizeof(ClockRange));
+ memcpy(newCR, cp, sizeof(ClockRange));
+ newCR->next = NULL;
if (scrp->clockRanges == NULL)
- scrp->clockRanges = storeClockRanges;
- memcpy(storeClockRanges, cp, sizeof(ClockRange));
+ scrp->clockRanges = newCR;
+ else
+ nt_list_append(newCR, scrp->clockRanges, ClockRange, next);
}
/* Determine which pixmap format to pass to scanLineWidth() */
diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index 40c9d15f4..607c33354 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -743,7 +743,7 @@ xf86TokenToOptName(const OptionInfoRec * table, int token)
const OptionInfoRec *p;
p = xf86TokenToOptinfo(table, token);
- return p->name;
+ return p ? p->name : NULL;
}
Bool
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
index c2e7bab9f..4da6af2b6 100644
--- a/hw/xfree86/common/xf86fbman.c
+++ b/hw/xfree86/common/xf86fbman.c
@@ -320,15 +320,17 @@ localRegisterFreeBoxCallback(ScreenPtr pScreen,
newCallbacks = realloc(offman->FreeBoxesUpdateCallback,
sizeof(FreeBoxCallbackProcPtr) *
(offman->NumCallbacks + 1));
+ if (!newCallbacks)
+ return FALSE;
+ else
+ offman->FreeBoxesUpdateCallback = newCallbacks;
newPrivates = realloc(offman->devPrivates,
sizeof(DevUnion) * (offman->NumCallbacks + 1));
-
- if (!newCallbacks || !newPrivates)
+ if (!newPrivates)
return FALSE;
-
- offman->FreeBoxesUpdateCallback = newCallbacks;
- offman->devPrivates = newPrivates;
+ else
+ offman->devPrivates = newPrivates;
offman->FreeBoxesUpdateCallback[offman->NumCallbacks] = FreeBoxCallback;
offman->devPrivates[offman->NumCallbacks].ptr = devPriv;
diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c
index 78a32bfe1..3169c054c 100644
--- a/hw/xfree86/common/xf86xvmc.c
+++ b/hw/xfree86/common/xf86xvmc.c
@@ -158,8 +158,10 @@ xf86XvMCScreenInit(ScreenPtr pScreen,
if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors)))
return FALSE;
- if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0))
+ if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0)) {
+ free(pAdapt);
return FALSE;
+ }
if (!(pScreenPriv = malloc(sizeof(xf86XvMCScreenRec)))) {
free(pAdapt);