linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: gfree.wind@vip.163.com
To: paulus@samba.org, davem@davemloft.net
Cc: linux-ppp@vger.kernel.org, netdev@vger.kernel.org,
	Gao Feng <gfree.wind@vip.163.com>
Subject: [PATCH net-next] ppp: Destroy the mutex when cleanup
Date: Tue, 31 Oct 2017 10:25:37 +0000	[thread overview]
Message-ID: <1509445537-39319-1-git-send-email-gfree.wind@vip.163.com> (raw)

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



             reply	other threads:[~2017-10-31 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 10:25 gfree.wind [this message]
2017-10-31 15:48 ` [PATCH net-next] ppp: Destroy the mutex when cleanup Guillaume Nault
2017-11-01 12:21 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1509445537-39319-1-git-send-email-gfree.wind@vip.163.com \
    --to=gfree.wind@vip.163.com \
    --cc=davem@davemloft.net \
    --cc=linux-ppp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).