From: Joe Jin Subject: Re: Re: [patch] netfront: unregister net device at backend_changed() if network_connect() failed Date: Wed, 19 Nov 2008 04:47:42 -0800 (PST) Message-ID: <234922a4-3cca-436a-bab2-0ae67f051907@default> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen-Devel List-Id: xen-devel@lists.xenproject.org > 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 =3D=3D NETREG_REGISTERED) unregister_netdev(info->netdev); <--snip--> } This will avoid the crash when call netfront_remove. Thanks, Joe