[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BFACBE0.4020109@trash.net>
Date: Mon, 24 May 2010 20:56:32 +0200
From: Patrick McHardy <kaber@...sh.net>
To: Jiri Pirko <jpirko@...hat.com>
CC: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH net-2.6] macvlan: do a proper cleanup in macvlan_common_newlink()
Jiri Pirko wrote:
> Mon, May 24, 2010 at 05:58:58PM CEST, jpirko@
> Subject: [PATCH net-2.6] macvlan: do proper cleanup in macvlan_common_newlink() V2
>
> Fixes possible memory leak.
Looks good, thanks.
> Signed-off-by: Jiri Pirko <jpirko@...hat.com>
Acked-by: Patrick McHardy <kaber@...sh.net>
> ---
> drivers/net/macvlan.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> index 4e238af..87e8d4c 100644
> --- a/drivers/net/macvlan.c
> +++ b/drivers/net/macvlan.c
> @@ -634,11 +634,18 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
>
> err = register_netdevice(dev);
> if (err < 0)
> - return err;
> + goto destroy_port;
>
> list_add_tail(&vlan->list, &port->vlans);
> netif_stacked_transfer_operstate(lowerdev, dev);
> +
> return 0;
> +
> +destroy_port:
> + if (list_empty(&port->vlans))
> + macvlan_port_destroy(lowerdev);
> +
> + return err;
> }
> EXPORT_SYMBOL_GPL(macvlan_common_newlink);
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists