Commit 44176d9f authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

Staging: mrst-touchscreen: fix dereferencing free memory

I moved the kfree() down a couple lines after the dereference.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent eb169d1c
...@@ -817,9 +817,9 @@ static int mrstouch_remove(struct spi_device *spi) ...@@ -817,9 +817,9 @@ static int mrstouch_remove(struct spi_device *spi)
free_irq(mrstouchdevp->irq, mrstouchdevp); free_irq(mrstouchdevp->irq, mrstouchdevp);
input_unregister_device(mrstouchdevp->input); input_unregister_device(mrstouchdevp->input);
input_free_device(mrstouchdevp->input); input_free_device(mrstouchdevp->input);
kfree(mrstouchdevp);
if (mrstouchdevp->pendet_thrd) if (mrstouchdevp->pendet_thrd)
kthread_stop(mrstouchdevp->pendet_thrd); kthread_stop(mrstouchdevp->pendet_thrd);
kfree(mrstouchdevp);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment