Skip to contentSkip to conversation

TSC2301 touchscreen: fix error path in driver probe function

PATCH In review Jarkko Nikula 2 participants 2 messages Mar 22, 2007 – Mar 30, 2007 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 TSC2301 touchscreen: fix error path in driver probe function

Patch from Imre.

Quoted 1 line

From a24e92946d20026e7d982c53abf816d5bf142df7 Mon Sep 17 00:00:00 2001

From: Imre Deak <[email protected]>
Date: Mon, 12 Mar 2007 17:46:25 +0200
Subject: [PATCH] TSC2301 touchscreen: fix error path in driver probe function

---
 drivers/spi/tsc2301-ts.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/spi/tsc2301-ts.c +8 -4
index da91736..8657b56 100644
@@ -629,19 +629,23 @@ int __devinit tsc2301_ts_init(struct tsc2301 *tsc,
 	}
 	set_irq_wake(ts->irq, 1);
 
-	device_create_file(&tsc->spi->dev, &dev_attr_pen_down);
-	device_create_file(&tsc->spi->dev, &dev_attr_disable_ts);
+	if (device_create_file(&tsc->spi->dev, &dev_attr_pen_down) < 0)
+		goto err4;
+	if (device_create_file(&tsc->spi->dev, &dev_attr_disable_ts) < 0)
+		goto err5;
 
 	r = input_register_device(idev);
 	if (r < 0) {
 		dev_err(&tsc->spi->dev, "can't register touchscreen device\n");
-		goto err4;
+		goto err6;
 	}
 
 	return 0;
-err4:
+err6:
 	device_remove_file(&tsc->spi->dev, &dev_attr_disable_ts);
+err5:
 	device_remove_file(&tsc->spi->dev, &dev_attr_pen_down);
+err4:
 	free_irq(ts->irq, tsc);
 err3:
 	tsc2301_ts_stop_scan(tsc);
Signature · 1 line
1.4.4.4
#1 lore raw
Quoted 6 lines · Jarkko Nikula

Patch from Imre.

Quoted 1 line

From a24e92946d20026e7d982c53abf816d5bf142df7 Mon Sep 17 00:00:00 2001

From: Imre Deak <[email protected]>
Date: Mon, 12 Mar 2007 17:46:25 +0200
Subject: [PATCH] TSC2301 touchscreen: fix error path in driver probe function

I have already applied this.

Tony