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

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



commit dd80ee80c9bf84c3c7d4c72ffe4c1a9d9d170bf9
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 12:39:36 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)
---
 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 5f539b1..9536018 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1329,20 +1329,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.3

_______________________________________________
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®.