]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/staging/mrst-touchscreen/intel-mid-touch.c
Staging: mrst-touchscreen: fix dereferencing free memory
[net-next-2.6.git] / drivers / staging / mrst-touchscreen / intel-mid-touch.c
index 1db00975a594ec8e859ab81db32a1db9acac22c5..abba22f921bec49b8f4d58123f33c8e01947380e 100644 (file)
@@ -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;
 }