xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: "Xen-Devel (xen-devel@lists.xensource.com)"
	<xen-devel@lists.xensource.com>
Subject: [PATCH] tmem: typo causes incorrect return on out-of-memory
Date: Tue, 9 Mar 2010 07:59:27 -0800 (PST)	[thread overview]
Message-ID: <963e65f3-8fda-4920-917b-cd0f0262315a@default> (raw)

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

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 <dan.magenheimer@oracle.com>

diff -r b8d2a4134a68 xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Mar 03 17:41:58 2010 +0000
+++ b/xen/common/tmem.c	Tue Mar 09 08:53:12 2010 -0700
@@ -1308,7 +1308,7 @@ copy_uncompressed:
 copy_uncompressed:
     if ( ( pgp->pfp = tmem_page_alloc(pool) ) == NULL )
     {
-        ret == -ENOMEM;
+        ret = -ENOMEM;
         goto delete_and_free;
     }
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */

[-- Attachment #2: tmem-typo.patch --]
[-- Type: application/octet-stream, Size: 433 bytes --]

diff -r b8d2a4134a68 xen/common/tmem.c
--- a/xen/common/tmem.c	Wed Mar 03 17:41:58 2010 +0000
+++ b/xen/common/tmem.c	Tue Mar 09 08:53:12 2010 -0700
@@ -1308,7 +1308,7 @@ copy_uncompressed:
 copy_uncompressed:
     if ( ( pgp->pfp = tmem_page_alloc(pool) ) == NULL )
     {
-        ret == -ENOMEM;
+        ret = -ENOMEM;
         goto delete_and_free;
     }
     /* tmh_copy_from_client properly handles len==0 (TMEM_NEW_PAGE) */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2010-03-09 15:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=963e65f3-8fda-4920-917b-cd0f0262315a@default \
    --to=dan.magenheimer@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).