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] alloc_netdev must be freed with free_netdev, not directl

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] alloc_netdev must be freed with free_netdev, not directly by kfree.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Feb 2006 18:32:10 +0000
Delivery-date: Mon, 20 Feb 2006 18:46:22 +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 vhanquez@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 011d6df7697987007205ff59e6d14de41cd47702
# Parent  bea58b594c4af6b34ce65e6db290884eb5bb463a
alloc_netdev must be freed with free_netdev, not directly by kfree.

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>

diff -r bea58b594c4a -r 011d6df76979 
linux-2.6-xen-sparse/drivers/xen/netback/loopback.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c       Mon Feb 20 
16:49:35 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c       Mon Feb 20 
17:06:36 2006
@@ -137,10 +137,13 @@
 
        sprintf(dev_name, "vif0.%d", i);
        dev1 = alloc_netdev(sizeof(struct net_private), dev_name, ether_setup);
+       if (!dev1)
+               return err;
+
        sprintf(dev_name, "veth%d", i);
        dev2 = alloc_netdev(sizeof(struct net_private), dev_name, ether_setup);
-       if ((dev1 == NULL) || (dev2 == NULL))
-               goto fail;
+       if (!dev2)
+               goto fail_netdev2;
 
        loopback_construct(dev1, dev2);
        loopback_construct(dev2, dev1);
@@ -169,8 +172,9 @@
        return 0;
 
  fail:
-       kfree(dev1);
-       kfree(dev2);
+       free_netdev(dev2);
+ fail_netdev2:
+       free_netdev(dev1);
        return err;
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] alloc_netdev must be freed with free_netdev, not directly by kfree., Xen patchbot -unstable <=