[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.4] libxl: poll: Make libxl__poller_get have only one success return path
commit 900c7970de4cb809ba208465cb0abd094b4dec58 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:37:22 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> --- 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 98cf565..6111deb 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -1378,20 +1378,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.4 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |