All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tmem: propagate ENOMEM result in error handling
@ 2014-03-29  5:07 Matthew Daley
  2014-03-30 21:09 ` Bob Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Daley @ 2014-03-29  5:07 UTC (permalink / raw)
  To: xen-devel; +Cc: Matthew Daley, xen-devel

...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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-03 18:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-29  5:07 [PATCH] tmem: propagate ENOMEM result in error handling Matthew Daley
2014-03-30 21:09 ` Bob Liu
2014-04-03 18:04   ` Konrad Rzeszutek Wilk

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.