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

Re: [Xen-devel] Re: [patch] netfront: unregister net device at backend_c

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [patch] netfront: unregister net device at backend_changed() if network_connect() failed
From: Joe Jin <joe.jin@xxxxxxxxxx>
Date: Wed, 19 Nov 2008 04:47:42 -0800 (PST)
Cc: Xen-Devel <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 19 Nov 2008 04:48:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> My point is, if you unregister_netdev() on failed network_connect(), and
> then do it unconditionally again in netfront_remove(), you will BUG_ON() in
> unregister_netdevice().

Sorry I dont notice that
Could we add a test in netfront_remove like below?
static int __devexit netfront_remove(struct xenbus_device *dev)
{
<--snip-->
      if (info->netdev->reg_state == NETREG_REGISTERED)
           unregister_netdev(info->netdev);
<--snip-->
}

This will avoid the crash when call netfront_remove.

Thanks,
Joe


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

<Prev in Thread] Current Thread [Next in Thread>