WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [linux-ppc-2.6] [POWERPC][XEN] Don't leak frame_list and don'r

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [linux-ppc-2.6] [POWERPC][XEN] Don't leak frame_list and don'r post process gnttab if OP fails
From: Xen patchbot-linux-ppc-2.6 <patchbot-linux-ppc-2.6@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 06 Feb 2007 22:30:56 +0000
Delivery-date: Wed, 07 Feb 2007 04:10:55 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 8bccc5d192be551cfe12e1c4d38bb49144f980aa
# Parent  5eca8383a521939f0d74e68eaddb049c5057742a
[POWERPC][XEN] Don't leak frame_list and don'r post process gnttab if OP fails

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 arch/powerpc/platforms/xen/gnttab.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff -r 5eca8383a521 -r 8bccc5d192be arch/powerpc/platforms/xen/gnttab.c
--- a/arch/powerpc/platforms/xen/gnttab.c       Tue Feb 06 16:21:30 2007 -0500
+++ b/arch/powerpc/platforms/xen/gnttab.c       Tue Feb 06 16:30:08 2007 -0500
@@ -244,10 +244,10 @@ static void gnttab_post_map_grant_ref(
 
 int HYPERVISOR_grant_table_op(unsigned int cmd, void *op, unsigned int count)
 {
-       void *desc = NULL;
+       void *desc;
        void *frame_list = NULL;
        int argsize;
-       int ret;
+       int ret = -ENOMEM;
 
        switch (cmd) {
        case GNTTABOP_map_grant_ref:
@@ -292,17 +292,14 @@ int HYPERVISOR_grant_table_op(unsigned i
        }
 
        desc = xencomm_map_no_alloc(op, argsize);
-
-       if (desc == NULL)
-               return -ENOSPC;
-
-       ret = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_grant_table_op), cmd,
-                                desc, count);
-       if (cmd == GNTTABOP_map_grant_ref)
-               gnttab_post_map_grant_ref(op, count);
-
+       if (desc) {
+               ret = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_grant_table_op),
+                                        cmd, desc, count);
+               if (!ret && cmd == GNTTABOP_map_grant_ref)
+                       gnttab_post_map_grant_ref(op, count);
+               xencomm_free(desc);
+       }
        xencomm_free(frame_list);
-       xencomm_free(desc);
 
        return ret;
 }

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [linux-ppc-2.6] [POWERPC][XEN] Don't leak frame_list and don'r post process gnttab if OP fails, Xen patchbot-linux-ppc-2 . 6 <=