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

[Xen-changelog] Fix a leak occurring at netif_map(). The problem raised

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix a leak occurring at netif_map(). The problem raised after allocating
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 29 Dec 2005 17:12:10 +0000
Delivery-date: Thu, 29 Dec 2005 17:17:08 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID f36627941bbe224ee7177f0ae63bba099376c668
# Parent  0e47bcdac69d08e4ca4c63b0e21d7ec4d8c11e2c
Fix a leak occurring at netif_map(). The problem raised after allocating
both {rx,tx}_comms_area, and one (and just one) of them failed. As we
were
doing a single test for both, returning would leave one of them
allocated.

Signed-off-by: Glauber de Oliveira Costa <glommer@xxxxxxxxxx>

diff -r 0e47bcdac69d -r f36627941bbe 
linux-2.6-xen-sparse/drivers/xen/netback/interface.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c      Wed Dec 28 
14:14:23 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c      Wed Dec 28 
14:17:04 2005
@@ -196,9 +196,13 @@
                return 0;
 
        netif->tx_comms_area = alloc_vm_area(PAGE_SIZE);
+       if (netif->tx_comms_area == NULL)
+               return -ENOMEM;
        netif->rx_comms_area = alloc_vm_area(PAGE_SIZE);
-       if (netif->tx_comms_area == NULL || netif->rx_comms_area == NULL)
+       if (netif->rx_comms_area == NULL) {
+               free_vm_area(netif->tx_comms_area);
                return -ENOMEM;
+       }
 
        err = map_frontend_pages(netif, tx_ring_ref, rx_ring_ref);
        if (err) {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix a leak occurring at netif_map(). The problem raised after allocating, Xen patchbot -unstable <=