Re: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-29 Thread Chunyan Zhang
ti On 29 June 2017 at 15:03, Greg Kroah-Hartman wrote: > On Thu, Jun 29, 2017 at 02:54:23PM +0800, Chunyan Zhang wrote: >> Hi Greg, >> >> On 28 June 2017 at 19:21, Greg Kroah-Hartman >> wrote: >> > On Wed, Jun 28, 2017 at 12:34:28PM +0200, Arnd Bergmann wrote: >> >> On Wed, Jun 28, 2017 at 7:1

Re: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-29 Thread Greg Kroah-Hartman
On Thu, Jun 29, 2017 at 02:54:23PM +0800, Chunyan Zhang wrote: > Hi Greg, > > On 28 June 2017 at 19:21, Greg Kroah-Hartman > wrote: > > On Wed, Jun 28, 2017 at 12:34:28PM +0200, Arnd Bergmann wrote: > >> On Wed, Jun 28, 2017 at 7:18 AM, Greg Kroah-Hartman > >> wrote: > >> > On Wed, Jun 28, 2017

Re: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-28 Thread Chunyan Zhang
Hi Greg, On 28 June 2017 at 19:21, Greg Kroah-Hartman wrote: > On Wed, Jun 28, 2017 at 12:34:28PM +0200, Arnd Bergmann wrote: >> On Wed, Jun 28, 2017 at 7:18 AM, Greg Kroah-Hartman >> wrote: >> > On Wed, Jun 28, 2017 at 09:54:32AM +0800, Orson Zhai wrote: >> >> We found the device is "fm". We hi

Re: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-28 Thread Greg Kroah-Hartman
On Wed, Jun 28, 2017 at 12:34:28PM +0200, Arnd Bergmann wrote: > On Wed, Jun 28, 2017 at 7:18 AM, Greg Kroah-Hartman > wrote: > > 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 reiniti

Re: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-28 Thread Arnd Bergmann
On Wed, Jun 28, 2017 at 7:18 AM, Greg Kroah-Hartman wrote: > 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

Re: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-27 Thread Greg Kroah-Hartman
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 co

Re: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-27 Thread Orson Zhai
Hi Greg & Arnd, On Tue, Jun 27, 2017 at 08:29:17AM +0200, Greg Kroah-Hartman wrote: > > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > A: Top-posting. > Q: What is the most annoying thing in e-mail? > > A: No. > Q: Should I inclu

Re: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-26 Thread Arnd Bergmann
On Mon, Jun 26, 2017 at 1:48 PM, Zhongping Tan (谭中平) wrote: > Hi Arnd: > If we can get list_add(&misc->list, &misc_list), then there is no problem at > all, but if the misc_register return "-EBUSY"(Maybe the same miscdevice > register twice ), then the deadloop will happen at list_for_each_entry

RE: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-26 Thread 谭中平
List; Zhongping Tan (谭中平) Subject: Re: [RFC PATCH] char: misc: Init misc->list in a safe way On Mon, Jun 26, 2017 at 11:31 AM, Orson Zhai wrote: > From: Zhongping Tan > > It is likely to enter a wrong case and return an error when > registerring a misc device. As a result, mi

Re: [RFC PATCH] char: misc: Init misc->list in a safe way

2017-06-26 Thread Arnd Bergmann
On Mon, Jun 26, 2017 at 11:31 AM, Orson Zhai wrote: > From: Zhongping Tan > > It is likely to enter a wrong case and return an error when registerring > a misc device. As a result, misc->list will be intialized to a dead loop > which is possible to go into wrong situation if anyone refers to it e