Re: [PATCH] spi/mxs: Fix device remove function

2012-08-27 Thread Mark Brown
On Fri, Aug 24, 2012 at 11:03:02AM -0700, Guenter Roeck wrote: > The call sequence spi_alloc_master/spi_register_master/spi_unregister_master > is complete; it reduces the device reference count to zero, which results in > device memory being freed. The remove function accesses the freed memory aft

Re: [PATCH] spi/mxs: Fix device remove function

2012-08-25 Thread Mark Brown
On Fri, Aug 24, 2012 at 01:37:39PM -0700, Guenter Roeck wrote: > For some reason most spi drivers have similar problems. I learned it > the hard way when I tested my own driver, and decided to fix as many > drivers as I can. Which is why you see all those patches from me > lately. It's not exactl

Re: [PATCH] spi/mxs: Fix device remove function

2012-08-24 Thread Guenter Roeck
On Sat, Aug 25, 2012 at 12:07:37AM +0200, Marek Vasut wrote: [ ... ] > > > On a side note, at least some of the spi bitbang drivers have a similar > > problem. Unfortunately, I can not fix it right now because I have no means > > to test it, and have no idea what exactly is _supposed_ to happen.

Re: [PATCH] spi/mxs: Fix device remove function

2012-08-24 Thread Marek Vasut
Dear Guenter Roeck, > On Fri, Aug 24, 2012 at 10:10:12PM +0200, Marek Vasut wrote: > > Dear Guenter Roeck, > > > > > The call sequence > > > spi_alloc_master/spi_register_master/spi_unregister_master is complete; > > > it reduces the device reference count to zero, which results in device > > > m

Re: [PATCH] spi/mxs: Fix device remove function

2012-08-24 Thread Guenter Roeck
On Fri, Aug 24, 2012 at 10:10:12PM +0200, Marek Vasut wrote: > Dear Guenter Roeck, > > > The call sequence > > spi_alloc_master/spi_register_master/spi_unregister_master is complete; it > > reduces the device reference count to zero, which results in device memory > > being freed. The remove funct

Re: [PATCH] spi/mxs: Fix device remove function

2012-08-24 Thread Marek Vasut
Dear Guenter Roeck, > The call sequence > spi_alloc_master/spi_register_master/spi_unregister_master is complete; it > reduces the device reference count to zero, which results in device memory > being freed. The remove function accesses the freed memory after the call > to spi_unregister_master()

[PATCH] spi/mxs: Fix device remove function

2012-08-24 Thread Guenter Roeck
The call sequence spi_alloc_master/spi_register_master/spi_unregister_master is complete; it reduces the device reference count to zero, which results in device memory being freed. The remove function accesses the freed memory after the call to spi_unregister_master(), _and_ it calls spi_master_put