[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] libxl: do not call exit() in libxl_device_vtpm_list
Marek Marczykowski wrote: > Signal error with NULL return value, do not terminate the whole process. > > Signed-off-by: Marek Marczykowski <marmarek@xxxxxxxxxxxxxxxxxxxxxx> > --- > tools/libxl/libxl.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index 03fd35a..5b9a3df 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -1860,11 +1860,12 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx > *ctx, uint32_t domid, int *n > vtpm->backend_domid = atoi(tmp); > > tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/uuid", be_path)); > - if(tmp) { > - if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) { > - LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a > bug!!\n", be_path, tmp); > - exit(1); > - } > Ouch. libxl shouldn't be calling exit :). > + if (tmp) { > + if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) { > + LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a > bug!!\n", be_path, tmp); > + free(vtpms); > + return NULL; > + } > } > } > } > Reviewed-by: Jim Fehlig <jfehlig@xxxxxxxx> Regards, Jim _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |