linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiaoming Ni <nixiaoming@huawei.com>
To: <gregkh@linuxfoundation.org>, <jslaby@suse.com>
Cc: <linux-kernel@vger.kernel.org>, <nixiaoming@huawei.com>
Subject: [PATCH] tty:n_gsm.c: destroy port by tty_port_destroy()
Date: Tue, 24 Sep 2019 17:25:56 +0800	[thread overview]
Message-ID: <1569317156-45850-1-git-send-email-nixiaoming@huawei.com> (raw)

According to the comment of tty_port_destroy():
    When a port was initialized using tty_port_init, one has to destroy
    the port by tty_port_destroy();

tty_port_init() is called in gsm_dlci_alloc()
so tty_port_destroy() needs to be called in gsm_dlci_free()

Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
---
 drivers/tty/n_gsm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 36a3eb4..3f5bcc9 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -1681,6 +1681,7 @@ static void gsm_dlci_free(struct tty_port *port)
 
 	del_timer_sync(&dlci->t1);
 	dlci->gsm->dlci[dlci->addr] = NULL;
+	tty_port_destroy(&dlci->port);
 	kfifo_free(dlci->fifo);
 	while ((dlci->skb = skb_dequeue(&dlci->skb_list)))
 		dev_kfree_skb(dlci->skb);
-- 
1.8.5.6


             reply	other threads:[~2019-09-24  9:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24  9:25 Xiaoming Ni [this message]
2019-10-31 10:11 ` [PATCH] tty:n_gsm.c: destroy port by tty_port_destroy() Jiri Slaby
2019-10-31 12:38   ` Xiaoming Ni
2019-11-04 16:49   ` Greg KH

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=1569317156-45850-1-git-send-email-nixiaoming@huawei.com \
    --to=nixiaoming@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.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).