Merge branch 'master' of git+ssh://people.freedesktop.org/~alanc/xserver into next

This commit is contained in:
Peter Hutterer 2013-02-15 11:58:52 +10:00
commit 88517ced1f
8 changed files with 38 additions and 27 deletions

View File

@ -2747,7 +2747,6 @@ init_system_idle_counter(const char *name, int deviceid)
{ {
CARD64 resolution; CARD64 resolution;
XSyncValue idle; XSyncValue idle;
IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
SyncCounter *idle_time_counter; SyncCounter *idle_time_counter;
IdleTimeQueryValue(NULL, &idle); IdleTimeQueryValue(NULL, &idle);
@ -2758,10 +2757,14 @@ init_system_idle_counter(const char *name, int deviceid)
IdleTimeQueryValue, IdleTimeQueryValue,
IdleTimeBracketValues); IdleTimeBracketValues);
priv->deviceid = deviceid; if (idle_time_counter != NULL) {
priv->value_less = priv->value_greater = NULL; IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
idle_time_counter->pSysCounterInfo->private = priv; priv->value_less = priv->value_greater = NULL;
priv->deviceid = deviceid;
idle_time_counter->pSysCounterInfo->private = priv;
}
return idle_time_counter; return idle_time_counter;
} }
@ -2786,6 +2789,6 @@ void SyncRemoveDeviceIdleTime(SyncCounter *counter)
/* FreeAllResources() frees all system counters before the devices are /* FreeAllResources() frees all system counters before the devices are
shut down, check if there are any left before freeing the device's shut down, check if there are any left before freeing the device's
counter */ counter */
if (!xorg_list_is_empty(&SysCounterList)) if (counter && !xorg_list_is_empty(&SysCounterList))
xorg_list_del(&counter->pSysCounterInfo->entry); xorg_list_del(&counter->pSysCounterInfo->entry);
} }

View File

@ -803,6 +803,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
RT_WINDOW, client, DixGetAttrAccess); RT_WINDOW, client, DixGetAttrAccess);
if (rc != Success) { if (rc != Success) {
client->errorValue = stuff->window; client->errorValue = stuff->window;
free(overlayWin);
return rc; return rc;
} }
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
@ -812,8 +813,10 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
* interest in the overlay window * interest in the overlay window
*/ */
pOc = compCreateOverlayClient(pScreen, client); pOc = compCreateOverlayClient(pScreen, client);
if (pOc == NULL) if (pOc == NULL) {
free(overlayWin);
return BadAlloc; return BadAlloc;
}
/* /*
* Make sure the overlay window exists * Make sure the overlay window exists
@ -822,6 +825,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
if (cs->pOverlayWin == NULL) if (cs->pOverlayWin == NULL)
if (!compCreateOverlayWindow(pScreen)) { if (!compCreateOverlayWindow(pScreen)) {
FreeResource(pOc->resource, RT_NONE); FreeResource(pOc->resource, RT_NONE);
free(overlayWin);
return BadAlloc; return BadAlloc;
} }
@ -831,6 +835,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
DixGetAttrAccess); DixGetAttrAccess);
if (rc != Success) { if (rc != Success) {
FreeResource(pOc->resource, RT_NONE); FreeResource(pOc->resource, RT_NONE);
free(overlayWin);
return rc; return rc;
} }
} }

View File

@ -858,7 +858,7 @@ hostx_load_keymap(void)
(max_keycode - min_keycode + 1) * (max_keycode - min_keycode + 1) *
width); width);
if (!ephyrKeySyms.map) if (!ephyrKeySyms.map)
return; goto out;
for (i = 0; i < (max_keycode - min_keycode + 1); i++) for (i = 0; i < (max_keycode - min_keycode + 1); i++)
for (j = 0; j < width; j++) for (j = 0; j < width; j++)
@ -871,6 +871,7 @@ hostx_load_keymap(void)
ephyrKeySyms.maxKeyCode = max_keycode; ephyrKeySyms.maxKeyCode = max_keycode;
ephyrKeySyms.mapWidth = width; ephyrKeySyms.mapWidth = width;
out:
XFree(keymap); XFree(keymap);
} }

View File

@ -1370,7 +1370,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
int saveType; int saveType;
PixmapFormatRec *BankFormat; PixmapFormatRec *BankFormat;
ClockRangePtr cp; ClockRangePtr cp;
ClockRangePtr storeClockRanges;
int numTimings = 0; int numTimings = 0;
range hsync[MAX_HSYNC]; range hsync[MAX_HSYNC];
range vrefresh[MAX_VREFRESH]; range vrefresh[MAX_VREFRESH];
@ -1492,16 +1491,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
/* /*
* Store the clockRanges for later use by the VidMode extension. * Store the clockRanges for later use by the VidMode extension.
*/ */
storeClockRanges = scrp->clockRanges; nt_list_for_each_entry(cp, clockRanges, next) {
while (storeClockRanges != NULL) { ClockRangePtr newCR = xnfalloc(sizeof(ClockRange));
storeClockRanges = storeClockRanges->next; memcpy(newCR, cp, sizeof(ClockRange));
} newCR->next = NULL;
for (cp = clockRanges; cp != NULL; cp = cp->next,
storeClockRanges = storeClockRanges->next) {
storeClockRanges = xnfalloc(sizeof(ClockRange));
if (scrp->clockRanges == NULL) if (scrp->clockRanges == NULL)
scrp->clockRanges = storeClockRanges; scrp->clockRanges = newCR;
memcpy(storeClockRanges, cp, sizeof(ClockRange)); else
nt_list_append(newCR, scrp->clockRanges, ClockRange, next);
} }
/* Determine which pixmap format to pass to scanLineWidth() */ /* Determine which pixmap format to pass to scanLineWidth() */

View File

@ -743,7 +743,7 @@ xf86TokenToOptName(const OptionInfoRec * table, int token)
const OptionInfoRec *p; const OptionInfoRec *p;
p = xf86TokenToOptinfo(table, token); p = xf86TokenToOptinfo(table, token);
return p->name; return p ? p->name : NULL;
} }
Bool Bool

View File

@ -320,15 +320,17 @@ localRegisterFreeBoxCallback(ScreenPtr pScreen,
newCallbacks = realloc(offman->FreeBoxesUpdateCallback, newCallbacks = realloc(offman->FreeBoxesUpdateCallback,
sizeof(FreeBoxCallbackProcPtr) * sizeof(FreeBoxCallbackProcPtr) *
(offman->NumCallbacks + 1)); (offman->NumCallbacks + 1));
if (!newCallbacks)
return FALSE;
else
offman->FreeBoxesUpdateCallback = newCallbacks;
newPrivates = realloc(offman->devPrivates, newPrivates = realloc(offman->devPrivates,
sizeof(DevUnion) * (offman->NumCallbacks + 1)); sizeof(DevUnion) * (offman->NumCallbacks + 1));
if (!newPrivates)
if (!newCallbacks || !newPrivates)
return FALSE; return FALSE;
else
offman->FreeBoxesUpdateCallback = newCallbacks; offman->devPrivates = newPrivates;
offman->devPrivates = newPrivates;
offman->FreeBoxesUpdateCallback[offman->NumCallbacks] = FreeBoxCallback; offman->FreeBoxesUpdateCallback[offman->NumCallbacks] = FreeBoxCallback;
offman->devPrivates[offman->NumCallbacks].ptr = devPriv; offman->devPrivates[offman->NumCallbacks].ptr = devPriv;

View File

@ -158,8 +158,10 @@ xf86XvMCScreenInit(ScreenPtr pScreen,
if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors))) if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors)))
return FALSE; return FALSE;
if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0)) if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0)) {
free(pAdapt);
return FALSE; return FALSE;
}
if (!(pScreenPriv = malloc(sizeof(xf86XvMCScreenRec)))) { if (!(pScreenPriv = malloc(sizeof(xf86XvMCScreenRec)))) {
free(pAdapt); free(pAdapt);

View File

@ -91,15 +91,16 @@ resort(unsigned char *s_block)
unsigned char *d_new, *d_ptr, *d_end, *s_ptr, *s_end; unsigned char *d_new, *d_ptr, *d_end, *s_ptr, *s_end;
unsigned char tmp; unsigned char tmp;
s_ptr = find_header(s_block);
if (!s_ptr)
return NULL;
s_end = s_block + EDID1_LEN; s_end = s_block + EDID1_LEN;
d_new = malloc(EDID1_LEN); d_new = malloc(EDID1_LEN);
if (!d_new) if (!d_new)
return NULL; return NULL;
d_end = d_new + EDID1_LEN; d_end = d_new + EDID1_LEN;
s_ptr = find_header(s_block);
if (!s_ptr)
return NULL;
for (d_ptr = d_new; d_ptr < d_end; d_ptr++) { for (d_ptr = d_new; d_ptr < d_end; d_ptr++) {
tmp = *(s_ptr++); tmp = *(s_ptr++);
*d_ptr = tmp; *d_ptr = tmp;