Skip to content

Commit

Permalink
tty:n_gsm.c: destroy port by tty_port_destroy()
Browse files Browse the repository at this point in the history
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>
Link: https://lore.kernel.org/r/1569317156-45850-1-git-send-email-nixiaoming@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Xiaoming Ni authored and Greg Kroah-Hartman committed Oct 4, 2019
1 parent 530c4ba commit 7726fb5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/tty/n_gsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7726fb5

Please sign in to comment.