From 2cb8e71744b9c0e0663b8a0419606a73f01562e9 Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Fri, 4 Apr 2014 11:08:24 +0200 Subject: [PATCH] tmem: propagate ENOMEM result in error handling ...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 Reviewed-by: Bob Liu Acked-by: Konrad Rzeszutek Wilk --- 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 342a6dbf40..73007f79a4 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: -- 2.39.5