From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH 07/11] x86: fold identical error paths in xenmem_add_to_physmap_one() Date: Wed, 21 Jun 2017 03:36:11 -0600 Message-ID: <594A5A2B0200007800165094@prv-mh.provo.novell.com> References: <594A57B10200007800165012@prv-mh.provo.novell.com> <594A57B10200007800165012@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part5E66401B.2__=" Return-path: Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNc3c-0000K2-4P for xen-devel@lists.xenproject.org; Wed, 21 Jun 2017 09:36:16 +0000 In-Reply-To: <594A57B10200007800165012@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel Cc: George Dunlap , Andrew Cooper List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part5E66401B.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -4899,11 +4899,8 @@ int xenmem_add_to_physmap_one( =20 if ( !paging_mode_translate(d) || (mfn =3D=3D 0) ) { - if ( page ) - put_page(page); - if ( space =3D=3D XENMAPSPACE_gmfn || space =3D=3D XENMAPSPACE_gmf= n_range ) - put_gfn(d, gfn); - return -EINVAL; + rc =3D -EINVAL; + goto put_both; } =20 /* Remove previously mapped page if it was present. */ --=__Part5E66401B.2__= Content-Type: text/plain; name="x86-xatp1-error-paths.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-xatp1-error-paths.patch" x86: fold identical error paths in xenmem_add_to_physmap_one()=0A=0ASigned-= off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/mm.c=0A+++ = b/xen/arch/x86/mm.c=0A@@ -4899,11 +4899,8 @@ int xenmem_add_to_physmap_one(= =0A =0A if ( !paging_mode_translate(d) || (mfn =3D=3D 0) )=0A = {=0A- if ( page )=0A- put_page(page);=0A- if ( = space =3D=3D XENMAPSPACE_gmfn || space =3D=3D XENMAPSPACE_gmfn_range )=0A- = put_gfn(d, gfn);=0A- return -EINVAL;=0A+ rc =3D = -EINVAL;=0A+ goto put_both;=0A }=0A =0A /* Remove previously= mapped page if it was present. */=0A --=__Part5E66401B.2__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --=__Part5E66401B.2__=--