From: Andrew Morton Subject: Re: [patch 2.6.26-rc3] spi: fix refcount-related spidev oops-on-rmmod Date: Fri, 23 May 2008 17:48:14 -0700 Message-ID: <20080523174814.cd2952c3.akpm@linux-foundation.org> References: <200805221348.38163.david-b@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Sebastian Siewior To: David Brownell Return-path: In-Reply-To: <200805221348.38163.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Thu, 22 May 2008 13:48:38 -0700 David Brownell wrote: > + /* ... after we unbound from the underlying device? */ > + spin_lock_irq(&spidev->spi_lock); > + dofree = (spidev->spi == NULL); > + spin_unlock_irq(&spidev->spi_lock); > + > + if (dofree) > + kfree(spidev); that's very weird-looking code. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/