aboutsummaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authormerge <null@invalid>2008-12-08 22:50:52 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-12-08 22:50:52 +0000
commitebb3f320edcc6c4665a71ea060ef2ce6a83402b0 (patch)
treebcc900f37c2f7ab72addce6555263bfe1dd85aca /drivers/input
parent31383993decd60a7cc783f402ad83ee8580008d3 (diff)
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-fix-s3c2410_ts-fifo-allocation-1228776491
pending-tracking-hist top was MERGE-via-stable-tracking-fix-s3c2410_ts-fifo-allocation-1228776491 / a85a8a282939b4f6800081f67e1d568e0b97bd7a ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-fix-s3c2410_ts-fifo-allocation stable-tracking-hist top was fix-s3c2410_ts-fifo-allocation / 56a57ba0d4c1d60869250d5f89fae61544f01012 ... parent commitmessage: From: Nelson Castillo <nelsoneci@gmail.com> Fix s3c2410_ts FIFO allocation When I added the FIFO improving the interrupts handlers I introduced a bug. The FIFO is allocated after the interrupts are requested. This makes the kernel crash if the touchscreen generates activity before the allocation takes place. This patch fixes the bug. I reproduced it and tested the fix in a GTA02. - Fix bug - Fix a typo Reported-by: Andy Green <andy@openmoko.com> Signed-off-by: Nelson Castillo <nelsoneci@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/s3c2410_ts.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index 8e6bc0a0371..4159adaec7c 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -427,6 +427,11 @@ static int __init s3c2410ts_probe(struct platform_device *pdev)
ts.dev->id.product = 0xBEEF;
ts.dev->id.version = S3C2410TSVERSION;
ts.state = TS_STATE_STANDBY;
+ ts.event_fifo = kfifo_alloc(TS_EVENT_FIFO_SIZE, GFP_KERNEL, NULL);
+ if (IS_ERR(ts.event_fifo)) {
+ ret = -EIO;
+ goto bail2;
+ }
/* create the filter chain set up for the 2 coordinates we produce */
ret = ts_filter_create_chain(
@@ -459,26 +464,17 @@ static int __init s3c2410ts_probe(struct platform_device *pdev)
goto bail4;
}
- ts.event_fifo = kfifo_alloc(TS_EVENT_FIFO_SIZE, GFP_KERNEL, NULL);
-
- if (IS_ERR(ts.event_fifo)) {
- ret = -EIO;
- goto bail5;
- }
-
dev_info(&pdev->dev, "successfully loaded\n");
/* All went ok, so register to the input system */
rc = input_register_device(ts.dev);
if (rc) {
ret = -EIO;
- goto bail6;
+ goto bail5;
}
return 0;
-bail6:
- kfifo_free(ts.event_fifo);
bail5:
free_irq(IRQ_TC, ts.dev);
free_irq(IRQ_ADC, ts.dev);
@@ -489,7 +485,8 @@ bail4:
disable_irq(IRQ_ADC);
bail3:
ts_filter_destroy_chain(ts.tsf);
-
+ kfifo_free(ts.event_fifo);
+bail2:
input_unregister_device(ts.dev);
bail1:
iounmap(base_addr);