public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: mrst-touchscreen: fix leaks
@ 2010-07-12 14:48 Kulikov Vasiliy
  2010-07-12 14:57 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Kulikov Vasiliy @ 2010-07-12 14:48 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Greg Kroah-Hartman, Alan Cox, Dan Carpenter, devel, linux-kernel

mrstouch_probe() must unregister input device, free requested IRQ and
input device in error path.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 drivers/staging/mrst-touchscreen/intel-mid-touch.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/mrst-touchscreen/intel-mid-touch.c b/drivers/staging/mrst-touchscreen/intel-mid-touch.c
index abba22f..8a72bbf 100644
--- a/drivers/staging/mrst-touchscreen/intel-mid-touch.c
+++ b/drivers/staging/mrst-touchscreen/intel-mid-touch.c
@@ -779,7 +779,7 @@ static int __devinit mrstouch_probe(struct spi_device *mrstouch_spi)
 				0, "mrstouch", tsdev);
 	if (err) {
 		dev_err(&tsdev->spi->dev, "unable to allocate irq\n");
-		goto mrstouch_err_free_mem;
+		goto mrstouch_err_unreg_input;
 	}
 
 	tsdev->pendet_thrd = kthread_run(mrstouch_pendet,
@@ -787,11 +787,16 @@ static int __devinit mrstouch_probe(struct spi_device *mrstouch_spi)
 	if (IS_ERR(tsdev->pendet_thrd)) {
 		dev_err(&tsdev->spi->dev, "kthread_run failed\n");
 		err = PTR_ERR(tsdev->pendet_thrd);
-		goto mrstouch_err_free_mem;
+		goto mrstouch_err_free_irq;
 	}
 	mrstouch_debug("%s", "Driver initialized");
 	return 0;
 
+mrstouch_err_free_irq:
+	free_irq(myirq, tsdev);
+mrstouch_err_unreg_input:
+	input_unregister_device(mrstouchdevp->input);
+	input_free_device(mrstouchdevp->input);
 mrstouch_err_free_mem:
 	kfree(tsdev);
 	return err;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: mrst-touchscreen: fix leaks
  2010-07-12 14:48 [PATCH] staging: mrst-touchscreen: fix leaks Kulikov Vasiliy
@ 2010-07-12 14:57 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2010-07-12 14:57 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: kernel-janitors, Greg Kroah-Hartman, Alan Cox, Dan Carpenter,
	devel, linux-kernel

On Mon, 12 Jul 2010 18:48:04 +0400
Kulikov Vasiliy <segooon@gmail.com> wrote:

> mrstouch_probe() must unregister input device, free requested IRQ and
> input device in error path.

It does indeed need to do some of this but your patch is versus an older
version of the driver and Dmitry already fixed this - plus a chunk of the
stuff vanished in turning it to a threaded IRQ


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-12 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-12 14:48 [PATCH] staging: mrst-touchscreen: fix leaks Kulikov Vasiliy
2010-07-12 14:57 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox