Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753428AbdF1FSX (ORCPT ); Wed, 28 Jun 2017 01:18:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44586 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751583AbdF1FSS (ORCPT ); Wed, 28 Jun 2017 01:18:18 -0400 Date: Wed, 28 Jun 2017 07:18:15 +0200 From: Greg Kroah-Hartman To: Zhongping Tan =?utf-8?B?KOiwreS4reW5syk=?= , Arnd Bergmann , Linux Kernel Mailing List Subject: Re: [RFC PATCH] char: misc: Init misc->list in a safe way Message-ID: <20170628051815.GA4748@kroah.com> References: <20170626093123.23838-1-orson.zhai@spreadtrum.com> <8f919e212d5149e286422d58a5732356@SHMBX02.spreadtrum.com> <20170627062917.GA10376@kroah.com> <20170628015431.GA32195@spreadtrum.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170628015431.GA32195@spreadtrum.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 906 Lines: 26 On Wed, Jun 28, 2017 at 09:54:32AM +0800, Orson Zhai wrote: > We found the device is "fm". We highly suspect that fm driver call > misc_register twice and reinitialize list to make ->pre & ->next > pointing to himself. > > Meanwhile, we checked fm driver and found nothing obviously wrong in the code. Do you have a pointer to this driver? Is it in the kernel tree? > Consider that this is a crash after 46 hours continuous power-on/off, > it maybe caused by some special cases we are hard to know for now. What would cause this driver to want to register/unregister itself? Is it "recycling" the misc structure, or creating it new each time? And what kernel version are you testing here? > We think it might make some sence to add protection code into > misc_register() at first. To protect from "foolish" callers? Usually we fix the calling code to not do foolish things. :) thanks, greg k-h