]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: use LIBXL__LOG in libxl_ctx_alloc coverity-tested/master
authorWei Liu <wei.liu2@citrix.com>
Mon, 14 Mar 2016 16:17:37 +0000 (16:17 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 14 Mar 2016 17:12:47 +0000 (17:12 +0000)
Coverity points out that using LOG macro dereferences gc which is NULL
at that point. Use LIBXL__LOG instead.

CID: 1343291

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c

index 4cdc1690c4d5e5d5b66c896e4c11e813be92b468..93e228d88d22912ad004b6832dc2d07b3c1e4cf8 100644 (file)
@@ -90,7 +90,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version,
     /* The mutex is special because we can't idempotently destroy it */
 
     if (libxl__init_recursive_mutex(ctx, &ctx->lock) < 0) {
-        LOG(ERROR, "Failed to initialize mutex");
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to initialize mutex");
         free(ctx);
         ctx = 0;
         rc = ERROR_FAIL;