[PATCH 1/2] Sync: Always initialise system counter list

Alan Coopersmith alan.coopersmith at oracle.com
Tue Jul 10 07:21:35 PDT 2012


On 07/10/12 01:10 AM, Daniel Stone wrote:
> Sync is designed to let you add system counters before the extension has
> been initialised, which means the system counter list may well be full
> of bees.  Make sure it's initialised before we add to it, to avoid the
> risk of fatal injury.
> 
> Signed-off-by: Daniel Stone <daniel at fooishbar.org>
> ---
>  Xext/sync.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Xext/sync.c b/Xext/sync.c
> index 8a333dd..b8f094d 100644
> --- a/Xext/sync.c
> +++ b/Xext/sync.c
> @@ -951,6 +951,7 @@ SyncCreateSystemCounter(const char *name,
>          if (RTCounter == 0) {
>              return NULL;
>          }
> +        xorg_list_init(&SysCounterList);
>      }
>  
>      pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
> @@ -2448,13 +2449,12 @@ SyncExtensionInit(void)
>      ExtensionEntry *extEntry;
>      int s;
>  
> -    xorg_list_init(&SysCounterList);
> -
>      for (s = 0; s < screenInfo.numScreens; s++)
>          miSyncSetup(screenInfo.screens[s]);
>  
>      if (RTCounter == 0) {
>          RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
> +        xorg_list_init(&SysCounterList);
>      }
>      RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm");
>      RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait");

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list