[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 06/13 V6] remus: implement the API to setup network buffering
On Tue, Jan 21, 2014 at 1:05 AM, Lai Jiangshan <laijs@xxxxxxxxxxxxxx> wrote: From: Shriram Rajagopalan <rshriram@xxxxxxxxx> IanJ's feedback last time was that the error code rc needs to be checked. If its a failure, then return NULL to the caller. If its a ENOENT, then use the
default name. +} And if the previous feedback were to be incorporated, then get_vifname's return value should be assigned to a variable and checked before printing or using it for
other purposes. + *num_vifs = -1; This code (free_qdiscs) is new. Have you tested it? While the control flow looks pretty sane, libnl has been evolving a bit ever since the 3.* series. If init_qdisc fails, it calls free_qdisc(). If any other setup stage after network buffering fails, it would invoke the teardown code, which also calls free_qdisc(). This may end up in a segfault.
I suggest adding a simple check to see if nlsock/qdisc_cache are NULL before attempting to execute the rest of the function. And after you free the qdisc_cache & nlsock, set them to NULL.
+static int init_qdiscs(libxl__gc *gc, Please set arraysize to 7 here, instead of the beginning of the function. Its more readable that way. + GCNEW_ARRAY(env, arraysize); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |