Skip to contentSkip to conversation

libxl: use LIBXL__LOG in libxl_ctx_alloc

PATCH In review Wei Liu 2 participants 2 messages Mar 14, 2016

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 libxl: use LIBXL__LOG in libxl_ctx_alloc

Coverity points out that using LOG macro dereferences gc which is NULL at that point. Use LIBXL__LOG instead.

CID: 1343291

---
Cc: Ian Jackson <[email protected]>

---
 tools/libxl/libxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl.c +1 -1
index 4cdc169..93e228d 100644
@@ -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;
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw

Wei Liu writes ("[PATCH] libxl: use LIBXL__LOG in libxl_ctx_alloc"):

Quoted 6 lines

Coverity points out that using LOG macro dereferences gc which is NULL at that point. Use LIBXL__LOG instead.

CID: 1343291

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel