From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Magenheimer Subject: [PATCH] tmem: typo causes incorrect return on out-of-memory Date: Tue, 9 Mar 2010 07:59:27 -0800 (PST) Message-ID: <963e65f3-8fda-4920-917b-cd0f0262315a@default> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="__126815038215210970abhmt001" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Xen-Devel (xen-devel@lists.xensource.com)" List-Id: xen-devel@lists.xenproject.org --__126815038215210970abhmt001 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable This classic typo in tmem would result in a false positive report on a tmem "put" operation if a (unfragmented) page of memory is completely unavailable. Signed-off-by: Dan Magenheimer diff -r b8d2a4134a68 xen/common/tmem.c --- a/xen/common/tmem.c=09Wed Mar 03 17:41:58 2010 +0000 +++ b/xen/common/tmem.c=09Tue Mar 09 08:53:12 2010 -0700 @@ -1308,7 +1308,7 @@ copy_uncompressed: copy_uncompressed: if ( ( pgp->pfp =3D tmem_page_alloc(pool) ) =3D=3D NULL ) { - ret =3D=3D -ENOMEM; + ret =3D -ENOMEM; goto delete_and_free; } /* tmh_copy_from_client properly handles len=3D=3D0 (TMEM_NEW_PAGE) */ --__126815038215210970abhmt001 Content-Type: application/octet-stream; name="tmem-typo.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="tmem-typo.patch" ZGlmZiAtciBiOGQyYTQxMzRhNjggeGVuL2NvbW1vbi90bWVtLmMKLS0tIGEveGVuL2NvbW1vbi90 bWVtLmMJV2VkIE1hciAwMyAxNzo0MTo1OCAyMDEwICswMDAwCisrKyBiL3hlbi9jb21tb24vdG1l bS5jCVR1ZSBNYXIgMDkgMDg6NTM6MTIgMjAxMCAtMDcwMApAQCAtMTMwOCw3ICsxMzA4LDcgQEAg Y29weV91bmNvbXByZXNzZWQ6CiBjb3B5X3VuY29tcHJlc3NlZDoKICAgICBpZiAoICggcGdwLT5w ZnAgPSB0bWVtX3BhZ2VfYWxsb2MocG9vbCkgKSA9PSBOVUxMICkKICAgICB7Ci0gICAgICAgIHJl dCA9PSAtRU5PTUVNOworICAgICAgICByZXQgPSAtRU5PTUVNOwogICAgICAgICBnb3RvIGRlbGV0 ZV9hbmRfZnJlZTsKICAgICB9CiAgICAgLyogdG1oX2NvcHlfZnJvbV9jbGllbnQgcHJvcGVybHkg aGFuZGxlcyBsZW49PTAgKFRNRU1fTkVXX1BBR0UpICovCg== --__126815038215210970abhmt001 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.xensource.com http://lists.xensource.com/xen-devel --__126815038215210970abhmt001--