|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] libxl: prepare environment for domcreate_stream_done
Olaf Hering writes ("[PATCH v2] libxl: prepare environment for
domcreate_stream_done"):
> 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.
Thanks. I think this is OK as far as it goes. But:
> + /* Prepare environment for domcreate_stream_done */
> + dcs->srs.dcs = dcs;
The need for this comment is telling us something about the weird code
structure here. We initialise all of dcs->srs much later, so even
with this change we call domcreate_stream_done with a
mostly-uninitialised srs.
In fact this is OK because domcreate_stream_done only reads srs->dcs
and then does everything with the obtained dcs. But there is nothing
there to indicate that srs might be mostly uninitialised. Maybe we
could add a comment there, something like:
/* NB perhaps only srs->dcs is valid; eg in the case of an
* early branch to domcreate_bootloader_done's `out' block */
?
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |