From: Imre Deak Date: Mon, 12 Mar 2007 15:46:25 +0000 (+0200) Subject: TSC2301 touchscreen: fix error path in driver probe function X-Git-Tag: v2.6.21-omap1~54 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=171dada7a1be6979d17335ba8fc5f15eff04fbf8;p=linux-2.6-omap-h63xx.git TSC2301 touchscreen: fix error path in driver probe function Signed-off-by: Imre Deak Signed-off-by: Tony Lindgren --- diff --git a/drivers/spi/tsc2301-ts.c b/drivers/spi/tsc2301-ts.c index da91736e913..8657b56641a 100644 --- a/drivers/spi/tsc2301-ts.c +++ b/drivers/spi/tsc2301-ts.c @@ -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);