Subject: Re: v3 [PATCH net-next 4/7] ipv6: Check return of dev_set_allmulti

From: Patrick McHardy <[email-masked]>
Date: Wed, 02 Jul 2008 14:54:21 +0200

Wang Chen wrote:
> v2->v3:
>   Do unwind job when error happen.
> 
> diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
> index 1479618..ba763b8 100644
> --- a/net/ipv6/ip6mr.c
> +++ b/net/ipv6/ip6mr.c
> @@ -461,6 +461,13 @@ failure:
>  	unregister_netdevice(dev);
>  	return NULL;
>  }
> +
> +static void ip6mr_unreg_vif(struct net_device *dev)
> +{
> +	dev_close(dev);
> +	unregister_netdevice(dev);

dev_close is already performed by unregister_netdevice.

> +	free_netdev(dev);

This is a double free, the device uses free_netdev as destructor.