[PATCH 03/54] Sync: Always initialise system counter list

Alan Coopersmith alan.coopersmith at oracle.com
Mon Jul 9 21:03:34 PDT 2012


On 07/ 9/12 06:02 PM, 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 |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Xext/sync.c b/Xext/sync.c
> index 91968e4..8c3b1a3 100644
> --- a/Xext/sync.c
> +++ b/Xext/sync.c
> @@ -948,6 +948,7 @@ SyncCreateSystemCounter(const char *name,
>          if (RTCounter == 0) {
>              return NULL;
>          }
> +        xorg_list_init(&SysCounterList);
>      }
>  
>      pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);

Should the xorg_list_init in SyncExtensionInit be moved inside its
if (RTCounter == 0) check then, so it doesn't reset the list back to
empty after you've done this?

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


More information about the xorg-devel mailing list