Skip to contentSkip to conversation

Staging: mrst-touchscreen: dereferencing free memory

PATCH In review Dan Carpenter 2 participants 2 messages Jun 5, 2010 – Jun 7, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: mrst-touchscreen: dereferencing free memory

I moved the kfree() down a couple lines after the dereference.

drivers/staging/mrst-touchscreen/intel-mid-touch.c +1 -1
index 1db0097..abba22f 100644
@@ -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;
 }