From: Dan Carpenter Date: Sat, 5 Jun 2010 17:16:42 +0000 (+0200) Subject: Staging: mrst-touchscreen: fix dereferencing free memory X-Git-Tag: Ubuntu-5.0.0-8.9~22548^2~12 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=44176d9f8265de799512f833ca4d9785aa016b3a;p=mirror_ubuntu-disco-kernel.git Staging: mrst-touchscreen: fix dereferencing free memory I moved the kfree() down a couple lines after the dereference. Signed-off-by: Dan Carpenter Acked-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/mrst-touchscreen/intel-mid-touch.c b/drivers/staging/mrst-touchscreen/intel-mid-touch.c index 1db00975a594..abba22f921be 100644 --- a/drivers/staging/mrst-touchscreen/intel-mid-touch.c +++ b/drivers/staging/mrst-touchscreen/intel-mid-touch.c @@ -817,9 +817,9 @@ static int mrstouch_remove(struct spi_device *spi) free_irq(mrstouchdevp->irq, mrstouchdevp); input_unregister_device(mrstouchdevp->input); input_free_device(mrstouchdevp->input); - kfree(mrstouchdevp); if (mrstouchdevp->pendet_thrd) kthread_stop(mrstouchdevp->pendet_thrd); + kfree(mrstouchdevp); return 0; }