Skip to contentSkip to conversation

kexec: propagate ENOMEM result in error handling

PATCH In review Matthew Daley 2 participants 2 messages Mar 29, 2014 – Apr 1, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: propagate ENOMEM result in error handling

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

---
 xen/common/kimage.c | 1 +
 1 file changed, 1 insertion(+)
xen/common/kimage.c +1 -0
index 91943f1..9b79a5e 100644
@@ -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;
Signature · 1 line
1.9.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Matthew Daley

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

Thanks.

David