diff options
| author | Rafael J. Wysocki <[email protected]> | 2015-10-09 22:13:30 +0200 | 
|---|---|---|
| committer | Rafael J. Wysocki <[email protected]> | 2015-10-09 22:13:30 +0200 | 
| commit | 670aee3fc7ac37ae947f8b582d87b51d5fa36524 (patch) | |
| tree | 9885998483d4506208e5aef9c13c8a86adea20bb /net/l2tp/l2tp_core.c | |
| parent | d61e87ac53292a3138b4354b687558973686b6ca (diff) | |
| parent | 55582bccdc1e89ecc973c260d46e247df675d4df (diff) | |
Merge branches 'pm-devfreq' and 'pm-cpufreq'
* pm-devfreq:
  PM / devfreq: fix double kfree
  PM / devfreq: Fix governor_store()
* pm-cpufreq:
  cpufreq: prevent lockup on reading scaling_available_frequencies
  cpufreq: acpi_cpufreq: prevent crash on reading freqdomain_cpus
Diffstat (limited to 'net/l2tp/l2tp_core.c')
| -rw-r--r-- | net/l2tp/l2tp_core.c | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index f6b090df3930..afca2eb4dfa7 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -1319,7 +1319,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work)  	tunnel = container_of(work, struct l2tp_tunnel, del_work);  	sk = l2tp_tunnel_sock_lookup(tunnel);  	if (!sk) -		return; +		goto out;  	sock = sk->sk_socket; @@ -1341,6 +1341,8 @@ static void l2tp_tunnel_del_work(struct work_struct *work)  	}  	l2tp_tunnel_sock_put(sk); +out: +	l2tp_tunnel_dec_refcount(tunnel);  }  /* Create a socket for the tunnel, if one isn't set up by @@ -1636,8 +1638,13 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create);   */  int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)  { +	l2tp_tunnel_inc_refcount(tunnel);  	l2tp_tunnel_closeall(tunnel); -	return (false == queue_work(l2tp_wq, &tunnel->del_work)); +	if (false == queue_work(l2tp_wq, &tunnel->del_work)) { +		l2tp_tunnel_dec_refcount(tunnel); +		return 1; +	} +	return 0;  }  EXPORT_SYMBOL_GPL(l2tp_tunnel_delete); |