From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH] kexec: propagate ENOMEM result in error handling Date: Sat, 29 Mar 2014 18:06:09 +1300 Message-ID: <1396069569-5659-1-git-send-email-mattd@bugfuzz.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WTlTR-0007Fl-A4 for xen-devel@lists.xenproject.org; Sat, 29 Mar 2014 05:06:29 +0000 Received: by mail-pa0-f54.google.com with SMTP id lf10so5895053pab.13 for ; Fri, 28 Mar 2014 22:06:26 -0700 (PDT) List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Matthew Daley , david.vrabel@citrix.com List-Id: xen-devel@lists.xenproject.org ...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 --- xen/common/kimage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/common/kimage.c b/xen/common/kimage.c index 91943f1..9b79a5e 100644 --- a/xen/common/kimage.c +++ b/xen/common/kimage.c @@ -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; -- 1.9.0