All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Daley <mattd@bugfuzz.com>
To: xen-devel@lists.xenproject.org
Cc: Matthew Daley <mattd@bugfuzz.com>, xen-devel@lists.xen.org
Subject: [PATCH] tmem: propagate ENOMEM result in error handling
Date: Sat, 29 Mar 2014 18:07:29 +1300	[thread overview]
Message-ID: <1396069649-5773-1-git-send-email-mattd@bugfuzz.com> (raw)

...otherwise if pcd_associate fails due to out-of-memory, the caller of
do_tmem_put will think the call was successful.

While at it, fix up the style issue.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
 xen/common/tmem.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 02e7e2e..9cebe11 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -1646,8 +1646,11 @@ copy_uncompressed:
 
     if ( tmem_dedup_enabled() && !is_persistent(pool) )
     {
-        if ( pcd_associate(pgp,NULL,0) == -ENOMEM )
+        if ( pcd_associate(pgp, NULL, 0) == -ENOMEM )
+        {
+            ret = -ENOMEM;
             goto del_pgp_from_obj;
+        }
     }
 
 insert_page:
-- 
1.9.0

             reply	other threads:[~2014-03-29  5:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-29  5:07 Matthew Daley [this message]
2014-03-30 21:09 ` [PATCH] tmem: propagate ENOMEM result in error handling Bob Liu
2014-04-03 18:04   ` Konrad Rzeszutek Wilk

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=1396069649-5773-1-git-send-email-mattd@bugfuzz.com \
    --to=mattd@bugfuzz.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.