[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a2941cab-03bc-9ff1-9a9e-9ab1af5c861f@redhat.com>
Date: Fri, 25 Nov 2016 10:48:58 +0800
From: Jason Wang <jasowang@...hat.com>
To: fgao@...vckh6395k16k5.yundunddos.com, davem@...emloft.net,
edumazet@...gle.com, netdev@...r.kernel.org, gfree.wind@...il.com
Subject: Re: [PATCH net 1/1] driver: macvtap: Unregister netdev rx_handler if
macvtap_newlink fails
On 2016年11月25日 10:05, fgao@...vckh6395k16k5.yundunddos.com wrote:
> From: Gao Feng <fgao@...ai8.com>
>
> The macvtap_newlink registers the netdev rx_handler firstly, but it
> does not unregister the handler if macvlan_common_newlink failed.
>
> Signed-off-by: Gao Feng <fgao@...ai8.com>
> ---
> drivers/net/macvtap.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
> index 070e329..bceca28 100644
> --- a/drivers/net/macvtap.c
> +++ b/drivers/net/macvtap.c
> @@ -491,7 +491,13 @@ static int macvtap_newlink(struct net *src_net,
> /* Don't put anything that may fail after macvlan_common_newlink
> * because we can't undo what it does.
> */
> - return macvlan_common_newlink(src_net, dev, tb, data);
> + err = macvlan_common_newlink(src_net, dev, tb, data);
> + if (err) {
> + netdev_rx_handler_unregister(dev);
> + return err;
> + }
> +
> + return 0;
> }
>
> static void macvtap_dellink(struct net_device *dev,
Acked-by: Jason Wang <jasowang@...hat.com>
Powered by blists - more mailing lists