From: Dragos Carp Subject: [PATCH] Re: drivers/spi/mpc52xx_psc_spi.c, potential use after free Date: Thu, 10 Jan 2008 15:19:06 +0100 Message-ID: <1199974746.3075.14.camel@carp.tuioptics.com> References: <20080107143025.GA21720@Chamillionaire.breakpoint.cc> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, David Brownell To: Sebastian Siewior Return-path: In-Reply-To: <20080107143025.GA21720-N26foeg2n7CSQxDm3FYtNwe+0vtP5+jfMa5aj3AfGnc@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 Fix mpc52xx_psc_spi_do_remove() use of drvdata after spi master unregister. Signed-off-by: Dragos Carp --- mpc52xx_psc_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index 7051e6c..a4463ba 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c @@ -534,10 +534,10 @@ static int __exit mpc52xx_psc_spi_do_remove(struct device *dev) flush_workqueue(mps->workqueue); destroy_workqueue(mps->workqueue); - spi_unregister_master(master); free_irq(mps->irq, mps); if (mps->psc) iounmap(mps->psc); + spi_unregister_master(master); return 0; } ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace