]> xenbits.xensource.com Git - xen.git/commitdiff
kexec: propagate ENOMEM result in error handling
authorMatthew Daley <mattd@bugfuzz.com>
Tue, 1 Apr 2014 14:48:02 +0000 (16:48 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 1 Apr 2014 14:48:02 +0000 (16:48 +0200)
...otherwise if kimage_alloc_control_page fails (presumably due to
out-of-memory; see the invocation just before this one), the caller of
do_kimage_alloc will think the call was successful.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
xen/common/kimage.c

index 91943f175a6108c959f2fd8c57de17e0c6946a09..9b79a5ed29ff929200a3c76f866e83e27e17e24c 100644 (file)
@@ -182,6 +182,7 @@ static int do_kimage_alloc(struct kexec_image **rimage, paddr_t entry,
         goto out;
 
     /* Add an empty indirection page. */
+    result = -ENOMEM;
     image->entry_page = kimage_alloc_control_page(image, 0);
     if ( !image->entry_page )
         goto out;