]> xenbits.xensource.com Git - xen.git/commitdiff
tmem: propagate ENOMEM result in error handling
authorMatthew Daley <mattd@bugfuzz.com>
Fri, 4 Apr 2014 09:08:24 +0000 (11:08 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Apr 2014 09:08:24 +0000 (11:08 +0200)
...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>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/common/tmem.c

index 342a6dbf40faff1c65b6b72fa2d57f4f9ed1b179..73007f79a4239ed1ffd4c1e8716425ac57abaa36 100644 (file)
@@ -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: