On 9/4/14 7:32, Stefano Stabellini wrote: > On Wed, 3 Sep 2014, Chen Gang wrote: >> On 9/3/14 0:22, Chen Gang wrote: [...] >>> xen_hvm_init() may also return -errno, which may let upper caller think >>> more (e.g. free some other related resources and try again), although at >>> present, all related upper callers still exit(1). > > I think we should return -1 in the other cases too >
[...] >>> @@ -998,6 +999,7 @@ int xen_hvm_init(ram_addr_t *below_4g_mem_size, >>> ram_addr_t *above_4g_mem_size, >>> state->xenstore = xs_daemon_open(); >>> if (state->xenstore == NULL) { >>> perror("xen: xenstore open"); >>> + xc_evtchn_close(state->xce_handle); >>> g_free(state); >>> return -errno; >>> } > > just return -1 and do the same in the above check (xce_handle == > XC_HANDLER_INITIAL_VALUE) > > OK thanks, what you said sounds OK to me. I shall send patch v2 for it within the 2 days (within 2014-09-05). Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed