Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753651AbdIRKua (ORCPT ); Mon, 18 Sep 2017 06:50:30 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36449 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751706AbdIRKu2 (ORCPT ); Mon, 18 Sep 2017 06:50:28 -0400 X-Google-Smtp-Source: ADKCNb7+wTfzT/nMSjRjFd6gdPD6c5yZ3zQpsVkA3dorD5SwMmtXrXQ2aIDq3EbIxgKju5J0KfNeqg== Subject: Re: [PATCH] tty fix oops when rmmod 8250 To: nixiaoming , adobriyan@gmail.com, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org References: <20170915094556.55384-1-nixiaoming@huawei.com> From: Jiri Slaby Message-ID: Date: Mon, 18 Sep 2017 10:43:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170915094556.55384-1-nixiaoming@huawei.com> Content-Type: text/plain; charset=iso-8859-2 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 968 Lines: 34 On 09/15/2017, 11:45 AM, nixiaoming wrote: > After rmmod 8250.ko > tty_kref_put starts kwork (release_one_tty) to release proc interface I believe you wanted to add a period here. > oops when accessing driver->driver_name in proc_tty_unregister_driver "The kernel oopses when"... ? > Use jprobe, found driver->driver_name point to 8250.ko > static static struct uart_driver serial8250_reg > .driver_name= serial, > > Use name in proc_dir_entry instead of driver->driver_name to fix oops > > test on linux 4.1.12: ... > @@ -164,7 +165,7 @@ void proc_tty_unregister_driver(struct tty_driver *driver) > if (!ent) > return; > > - remove_proc_entry(driver->driver_name, proc_tty_driver); > + remove_proc_entry(ent->name, proc_tty_driver); Yes, that makes sense. Using possibly stale driver_name cannot really work out. I only wonder why nobody noticed until now... So, can you reproduce also on 4.13 or something newer like that? thanks, -- js suse labs