netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/8] vxlan: Fix error handling while creating device.
@ 2013-06-20  7:26 Pravin B Shelar
  2013-06-20 15:47 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Pravin B Shelar @ 2013-06-20  7:26 UTC (permalink / raw)
  To: netdev, dev; +Cc: Pravin B Shelar

Delete vxlan-sock list entry from list before freeing the memory.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
 drivers/net/vxlan.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 284c6c0..173705f 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1606,9 +1606,11 @@ static int vxlan_newlink(struct net *net, struct net_device *dev,
 	err = register_netdevice(dev);
 	if (err) {
 		if (--vs->refcnt == 0) {
+			hlist_del_rcu(&vs->hlist);
 			rtnl_unlock();
+
 			sk_release_kernel(vs->sock->sk);
-			kfree(vs);
+			kfree_rcu(vs, rcu);
 			rtnl_lock();
 		}
 		return err;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next 1/8] vxlan: Fix error handling while creating device.
  2013-06-20  7:26 [PATCH net-next 1/8] vxlan: Fix error handling while creating device Pravin B Shelar
@ 2013-06-20 15:47 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2013-06-20 15:47 UTC (permalink / raw)
  To: Pravin B Shelar; +Cc: netdev, dev

On Thu, 20 Jun 2013 00:26:25 -0700
Pravin B Shelar <pshelar@nicira.com> wrote:

> Delete vxlan-sock list entry from list before freeing the memory.
> 
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
> ---
>  drivers/net/vxlan.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 284c6c0..173705f 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -1606,9 +1606,11 @@ static int vxlan_newlink(struct net *net, struct net_device *dev,
>  	err = register_netdevice(dev);
>  	if (err) {
>  		if (--vs->refcnt == 0) {
> +			hlist_del_rcu(&vs->hlist);
>  			rtnl_unlock();
> +
>  			sk_release_kernel(vs->sock->sk);
> -			kfree(vs);
> +			kfree_rcu(vs, rcu);
>  			rtnl_lock();
>  		}
>  		return err;

This will not be necessary with my next patch set, that code all changes.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-20 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20  7:26 [PATCH net-next 1/8] vxlan: Fix error handling while creating device Pravin B Shelar
2013-06-20 15:47 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).