[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.2] libxl: poll: Make libxl__poller_get have only one success return path



commit ebc342efbf5909ed95720945d44ad17e53156f71
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Thu Jul 9 16:52:02 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Wed Aug 12 13:09:54 2015 +0100

    libxl: poll: Make libxl__poller_get have only one success return path
    
    In preparation for doing some more work on successful exit.
    
    No functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
    CC: Jim Fehlig <jfehlig@xxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Tested-by: Jim Fehlig <jfehlig@xxxxxxxx>
    (cherry picked from commit 6fc946bc5520ebdbba5cbae4d49e53895df8b393)
    
    (cherry picked from commit 8c409135e69c7321cb6d82b8cae0868a81d05ddc)
    Conflicts:
        tools/libxl/libxl_event.c
    Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    (cherry picked from commit 900c7970de4cb809ba208465cb0abd094b4dec58)
    (cherry picked from commit dd80ee80c9bf84c3c7d4c72ffe4c1a9d9d170bf9)
---
 tools/libxl/libxl_event.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index f3c1019..87c04a9 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1328,20 +1328,19 @@ libxl__poller *libxl__poller_get(libxl_ctx *ctx)
     libxl__poller *p = LIBXL_LIST_FIRST(&ctx->pollers_idle);
     if (p) {
         LIBXL_LIST_REMOVE(p, entry);
-        return p;
-    }
-
-    p = malloc(sizeof(*p));
-    if (!p) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot allocate poller");
-        return 0;
-    }
-    memset(p, 0, sizeof(*p));
+    } else {
+        p = malloc(sizeof(*p));
+        if (!p) {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot allocate poller");
+            return 0;
+        }
+        memset(p, 0, sizeof(*p));
 
-    rc = libxl__poller_init(ctx, p);
-    if (rc) {
-        free(p);
-        return NULL;
+        rc = libxl__poller_init(ctx, p);
+        if (rc) {
+            free(p);
+            return NULL;
+        }
     }
 
     return p;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.