From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] 'dom' error handled, by raising ENOMEM if failure occurs. 'xs_fd' leak handled in success path. Date: Tue, 27 Oct 2015 11:55:05 +0100 Message-ID: <1445943305.2937.99.camel@citrix.com> References: <1445984373-8087-1-git-send-email-comethalley61@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8554349016236043238==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zr1uV-0001ih-Gi for xen-devel@lists.xenproject.org; Tue, 27 Oct 2015 10:55:23 +0000 In-Reply-To: <1445984373-8087-1-git-send-email-comethalley61@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Lasya , xen-devel@lists.xenproject.org, george.dunlap@citrix.com, lars.kurth@citrix.com, wei.liu2@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org --===============8554349016236043238== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-iSVQQbZyYL4hAn31HJDH" --=-iSVQQbZyYL4hAn31HJDH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2015-10-28 at 03:49 +0530, Lasya wrote: The description of the patch, that you previously put in a separate email, should live here. Also, this is the second version of a patch. That should be evident from the subject line (something like "[PATCH v2]"). And still about the subject line, it's a bit long. It must contain a very quick hint at what the patch is about, then all the details go in the patch description (also called changelog), i.e., right in here. :-) > Signed-off-by: Lasya Venneti > --- > tools/xenstore/init-xenstore-domain.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/tools/xenstore/init-xenstore-domain.c > b/tools/xenstore/init-xenstore-domain.c > index 0d12169..b413b09 100644 > --- a/tools/xenstore/init-xenstore-domain.c > +++ b/tools/xenstore/init-xenstore-domain.c > @@ -42,6 +42,10 @@ static int build(xc_interface *xch, int argc, > char** argv) > snprintf(cmdline, 512, "--event %d --internal-db", rv); > =20 > dom =3D xc_dom_allocate(xch, cmdline, NULL); > + if(dom=3D=3DNULL) { > + rv=3DENOMEM; > + goto err; > + } > A lot of spaces are missing... > rv =3D xc_dom_kernel_file(dom, argv[1]); ^ ^ | | ----------------------------------------------- | Just, for instance, compare what you added with this: --- > if (rv) goto err; ^ | -------- | And with this: --- > @@ -70,7 +74,8 @@ static int build(xc_interface *xch, int argc, > char** argv) > if (rv) goto err; > rv =3D xc_domain_unpause(xch, domid); > if (rv) goto err; > - > +=09 > What happened here? > + close(xs_fd); > return 0; >=20 Also, Wei suggested to send two patches, one for fixing the error handling for xc_dom_allocate(), and another one for stopping leaking the fd on the success path. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-iSVQQbZyYL4hAn31HJDH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlYvWAkACgkQk4XaBE3IOsQaRQCbBYD5wjV6Ftvkouo/Lk6oS3nN zYgAn0D3u2IxGPEZdOFqRmcKkyL13g9c =/EgZ -----END PGP SIGNATURE----- --=-iSVQQbZyYL4hAn31HJDH-- --===============8554349016236043238== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============8554349016236043238==--