From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] xen/sched_rc: Fix memory leak in rt_init() Date: Fri, 5 Jun 2015 12:07:39 +0200 Message-ID: <1433498859.21654.9.camel@citrix.com> References: <1433497776-8385-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5557492728447519532==" Return-path: In-Reply-To: <1433497776-8385-1-git-send-email-andrew.cooper3@citrix.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: Andrew Cooper Cc: George Dunlap , Keir Fraser , Meng Xu , Jan Beulich , Xen-devel List-Id: xen-devel@lists.xenproject.org --===============5557492728447519532== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-cRbCpPz991HbPBiGtwH5" --=-cRbCpPz991HbPBiGtwH5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-06-05 at 10:49 +0100, Andrew Cooper wrote: > Introduced by c/s 376bbba "sched_rt: print useful affinity info when dump= ing". > If the allocation of cpumask failed, prv was leaked. >=20 Wow... I really did a _great_ job with that patch, didn't I? :-// > Signed-off-by: Andrew Cooper > Coverity-ID: 1304398 > CC: Keir Fraser > CC: Jan Beulich > CC: Dario Faggioli > CC: George Dunlap > CC: Meng Xu > Reviewed-by: Dario Faggioli Although, I'd rather... > diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c > index 5836d27..4372486 100644 > --- a/xen/common/sched_rt.c > +++ b/xen/common/sched_rt.c > @@ -441,7 +441,7 @@ static inline struct list_head *rt_depletedq(const st= ruct scheduler *ops) > { > _cpumask_scratch =3D xmalloc_array(cpumask_var_t, nr_cpu_ids); > if ( !_cpumask_scratch ) > - return -ENOMEM; > + goto no_mem; > free it right away here (just one added line), instead of "clobbering" the tail of the function, since it's just this. But, really, I'm ok with the fix as is. Thanks for taking the time of sending the patch! :-) Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-cRbCpPz991HbPBiGtwH5 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 v2 iEYEABECAAYFAlVxdOsACgkQk4XaBE3IOsQdWwCfTntCI952eN9kQNauz3yqeeK5 wIYAoK3tkpaFZpARsYwMwOlxSMeWKvjY =4cFG -----END PGP SIGNATURE----- --=-cRbCpPz991HbPBiGtwH5-- --===============5557492728447519532== 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 --===============5557492728447519532==--