All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] libxl: prepare environment for domcreate_stream_done
@ 2019-03-08 12:24 Olaf Hering
  2019-03-08 12:29 ` Wei Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Olaf Hering @ 2019-03-08 12:24 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, Olaf Hering, Ian Jackson

The function domcreate_bootloader_done may branch early to
domcreate_stream_done, in case some error occoured. Here srs->dcs will be
NULL, which leads to a crash.

It is unclear what the purpose of that backpointer is. Perhaps it can be
removed, and domcreate_stream_done could use CONTAINER_OF.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
v2:
 unconditional assignment

 tools/libxl/libxl_create.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index a4e74a5cd2..c8b5ea984b 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1093,6 +1093,9 @@ static void domcreate_bootloader_done(libxl__egc *egc,
         return;
     }
 
+    /* Prepare environment for domcreate_stream_done */
+    dcs->srs.dcs = dcs;
+
     /* Restore */
     callbacks->restore_results = libxl__srm_callout_callback_restore_results;
 
@@ -1116,7 +1119,6 @@ static void domcreate_bootloader_done(libxl__egc *egc,
         goto out;
 
     dcs->srs.ao = ao;
-    dcs->srs.dcs = dcs;
     dcs->srs.fd = restore_fd;
     dcs->srs.legacy = (dcs->restore_params.stream_version == 1);
     dcs->srs.back_channel = false;

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-11  6:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-08 12:24 [PATCH v2] libxl: prepare environment for domcreate_stream_done Olaf Hering
2019-03-08 12:29 ` Wei Liu
2019-03-08 14:08 ` Ian Jackson
2019-03-08 14:43   ` Olaf Hering
2019-03-08 15:09     ` Wei Liu
2019-03-08 15:21     ` [PATCH for-4.12 " Ian Jackson
2019-03-11  6:42 ` Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.