diff options
Diffstat (limited to 'xorg-server/dix')
-rw-r--r-- | xorg-server/dix/dispatch.c | 6 | ||||
-rw-r--r-- | xorg-server/dix/events.c | 6 | ||||
-rw-r--r-- | xorg-server/dix/grabs.c | 11 |
3 files changed, 12 insertions, 11 deletions
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index e28270c16..9a5658db0 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -260,12 +260,11 @@ SmartScheduleClient(int *clientReady, int nready) for (i = 0; i < nready; i++) { client = clientReady[i]; pClient = clients[client]; - /* Praise clients which are idle */ - if ((now - pClient->smart_check_tick) >= idle) { + /* Praise clients which haven't run in a while */ + if ((now - pClient->smart_stop_tick) >= idle) { if (pClient->smart_priority < 0) pClient->smart_priority++; } - pClient->smart_check_tick = now; /* check priority to select best client */ robin = @@ -3424,7 +3423,6 @@ InitClient(ClientPtr client, int i, void *ospriv) QueryMinMaxKeyCodes(&client->minKC, &client->maxKC); client->smart_start_tick = SmartScheduleTime; client->smart_stop_tick = SmartScheduleTime; - client->smart_check_tick = SmartScheduleTime; client->clientIds = NULL; } diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c index ddbd4d281..f05dada3d 100644 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -3961,6 +3961,8 @@ CheckPassiveGrabsOnWindow(WindowPtr pWin, return NULL; tempGrab = AllocGrab(NULL); + if (tempGrab == NULL) + return NULL; /* Fill out the grab details, but leave the type for later before * comparing */ @@ -5056,7 +5058,7 @@ ProcUngrabPointer(ClientPtr client) * @param other_mode GrabModeSync or GrabModeAsync * @param status Return code to be returned to the caller. * - * @returns Success or BadValue. + * @returns Success or BadValue or BadAlloc. */ int GrabDevice(ClientPtr client, DeviceIntPtr dev, @@ -5137,6 +5139,8 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev, GrabPtr tempGrab; tempGrab = AllocGrab(NULL); + if (tempGrab == NULL) + return BadAlloc; tempGrab->next = NULL; tempGrab->window = pWin; diff --git a/xorg-server/dix/grabs.c b/xorg-server/dix/grabs.c index 5fd68202a..e3fc38bf5 100644 --- a/xorg-server/dix/grabs.c +++ b/xorg-server/dix/grabs.c @@ -199,12 +199,11 @@ AllocGrab(const GrabPtr src) free(grab); grab = NULL; } - } - - if (src && !CopyGrab(grab, src)) { - free(grab->xi2mask); - free(grab); - grab = NULL; + else if (src && !CopyGrab(grab, src)) { + free(grab->xi2mask); + free(grab); + grab = NULL; + } } return grab; |