Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1717178ybn; Thu, 26 Sep 2019 00:47:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoXGvk3fAXA6KiGeV/I1sQyioiQ2oja1kHMjU0cGMrM0xlgF3jP0WYvN7B5Eui6JcnIJuS X-Received: by 2002:a50:d096:: with SMTP id v22mr2111534edd.81.1569484050352; Thu, 26 Sep 2019 00:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569484050; cv=none; d=google.com; s=arc-20160816; b=Lx+mB243bxXd8XEnDIzCp/q++REwajKngxaVNikszENZNSByViIfY653oemKtD8sEl 62le2Z+RgyJQFTGP6GeLZg+LtDS8q77RhqPw8z/BXOYBem29ZczzStR8ZelNUY6bDDyN IdsXLDyaIeMUPDeTblYmpD4pUovtcD+AMhjKwuIP0tUfTHewY0Heaxah6Zte+iILd466 OEnajX/EeGg/9XSr6Wy8KgeCN2sjbPzqQTEcHaVDRZ24ctcaEJX9YNUwFkbyNx0z5Feg 5JYfu4pM50gbB0B3WzIDpKUmKaynIJJZdW+LPEefO5Wxt/m1WGixYZZP3oosH9O+NK6W dHPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=OnvaCClJu0AO2s0sdVUne9eph4V8ddYq//2LyNOPopk=; b=pz0+DZZb6WrOBabhx4l3m5sZYilKOpD1au2SMtQWBxA+wrQg1Ho7SR61MWFUseDb34 pFjkodNU+rh99uA7zzVeqBUe47UfQlrfpCUMCyFPqukKc0CvKaEEEOfMhUwYTFvXAXrd 5i62FT+orfFPmFoVtWFVW2CKUabytOaROMV4I/m5j58yOEer/RfyP9CJ2RVZ2MHYNe11 V8+xdU0NfRwoVPGTY+dND7XGQg8OQw22niz37sHON4t8DN9vQw6/x6c3fpEL7nyxd0Ru lK7rmltMvXNYFFykeMjhmAFFuwTvAB2AgShP2Bf5lWnb5Wh50/9h0mCSuX8Ym6WeQmib E79A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca4si593023ejb.39.2019.09.26.00.47.06; Thu, 26 Sep 2019 00:47:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504184AbfIXJ0L (ORCPT + 99 others); Tue, 24 Sep 2019 05:26:11 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2772 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729643AbfIXJ0L (ORCPT ); Tue, 24 Sep 2019 05:26:11 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7204EC4F7326A7C97CB1; Tue, 24 Sep 2019 17:26:09 +0800 (CST) Received: from use12-sp2.huawei.com (10.67.189.174) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Tue, 24 Sep 2019 17:26:00 +0800 From: Xiaoming Ni To: , CC: , Subject: [PATCH] tty:n_gsm.c: destroy port by tty_port_destroy() Date: Tue, 24 Sep 2019 17:25:56 +0800 Message-ID: <1569317156-45850-1-git-send-email-nixiaoming@huawei.com> X-Mailer: git-send-email 1.8.5.6 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.189.174] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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