linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ppp: Destroy the mutex when cleanup
@ 2017-10-31 10:25 gfree.wind
  2017-10-31 15:48 ` Guillaume Nault
  2017-11-01 12:21 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: gfree.wind @ 2017-10-31 10:25 UTC (permalink / raw)
  To: paulus, davem; +Cc: linux-ppp, netdev, Gao Feng

From: Gao Feng <gfree.wind@vip.163.com>

The mutex_destroy only makes sense when enable DEBUG_MUTEX. For the
good readbility, it's better to invoke it in exit func when the init
func invokes mutex_init.

Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
---
 drivers/net/ppp/ppp_generic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index af7f93e..4489133 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -960,6 +960,7 @@ static __net_exit void ppp_exit_net(struct net *net)
 	unregister_netdevice_many(&list);
 	rtnl_unlock();
 
+	mutex_destroy(&pn->all_ppp_mutex);
 	idr_destroy(&pn->units_idr);
 }
 
-- 
1.9.1



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

* Re: [PATCH net-next] ppp: Destroy the mutex when cleanup
  2017-10-31 10:25 [PATCH net-next] ppp: Destroy the mutex when cleanup gfree.wind
@ 2017-10-31 15:48 ` Guillaume Nault
  2017-11-01 12:21 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Guillaume Nault @ 2017-10-31 15:48 UTC (permalink / raw)
  To: gfree.wind; +Cc: paulus, davem, linux-ppp, netdev

On Tue, Oct 31, 2017 at 06:25:37PM +0800, gfree.wind@vip.163.com wrote:
> From: Gao Feng <gfree.wind@vip.163.com>
> 
> The mutex_destroy only makes sense when enable DEBUG_MUTEX. For the
> good readbility, it's better to invoke it in exit func when the init
> func invokes mutex_init.
> 
> Signed-off-by: Gao Feng <gfree.wind@vip.163.com>
> ---
>  drivers/net/ppp/ppp_generic.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
> index af7f93e..4489133 100644
> --- a/drivers/net/ppp/ppp_generic.c
> +++ b/drivers/net/ppp/ppp_generic.c
> @@ -960,6 +960,7 @@ static __net_exit void ppp_exit_net(struct net *net)
>  	unregister_netdevice_many(&list);
>  	rtnl_unlock();
>  
> +	mutex_destroy(&pn->all_ppp_mutex);
>  	idr_destroy(&pn->units_idr);
>  }
>  

Acked-by: Guillaume Nault <g.nault@alphalink.fr>

Thanks!

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

* Re: [PATCH net-next] ppp: Destroy the mutex when cleanup
  2017-10-31 10:25 [PATCH net-next] ppp: Destroy the mutex when cleanup gfree.wind
  2017-10-31 15:48 ` Guillaume Nault
@ 2017-11-01 12:21 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-11-01 12:21 UTC (permalink / raw)
  To: gfree.wind; +Cc: paulus, linux-ppp, netdev

From: gfree.wind@vip.163.com
Date: Tue, 31 Oct 2017 18:25:37 +0800

> From: Gao Feng <gfree.wind@vip.163.com>
> 
> The mutex_destroy only makes sense when enable DEBUG_MUTEX. For the
> good readbility, it's better to invoke it in exit func when the init
> func invokes mutex_init.
> 
> Signed-off-by: Gao Feng <gfree.wind@vip.163.com>

Applied.

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

end of thread, other threads:[~2017-11-01 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 10:25 [PATCH net-next] ppp: Destroy the mutex when cleanup gfree.wind
2017-10-31 15:48 ` Guillaume Nault
2017-11-01 12:21 ` David Miller

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).