summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/stmpe-ts.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-09-03 06:54:27 +0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-09-05 23:09:12 +0400
commitcdd194779b72fe6d5e1b5b67ef57a0fddbd60eac (patch)
tree999f398bac1e40138afe262368ff4febff7760aa /drivers/input/touchscreen/stmpe-ts.c
parent843cbfa74f1a443ce0def7fcc799803f34faa71c (diff)
downloadlinux-cdd194779b72fe6d5e1b5b67ef57a0fddbd60eac.tar.xz
Input: stmpe-ts - return -ENOMEM when memory allocation fails
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen/stmpe-ts.c')
-rw-r--r--drivers/input/touchscreen/stmpe-ts.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
index 0339d1d0d29e..ae88e13c99ff 100644
--- a/drivers/input/touchscreen/stmpe-ts.c
+++ b/drivers/input/touchscreen/stmpe-ts.c
@@ -268,7 +268,7 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
struct stmpe_touch *ts;
struct input_dev *idev;
struct stmpe_ts_platform_data *ts_pdata = NULL;
- int ret = 0;
+ int ret;
int ts_irq;
ts_irq = platform_get_irq_byname(pdev, "FIFO_TH");
@@ -276,12 +276,16 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
return ts_irq;
ts = kzalloc(sizeof(*ts), GFP_KERNEL);
- if (!ts)
+ if (!ts) {
+ ret = -ENOMEM;
goto err_out;
+ }
idev = input_allocate_device();
- if (!idev)
+ if (!idev) {
+ ret = -ENOMEM;
goto err_free_ts;
+ }
platform_set_drvdata(pdev, ts);
ts->stmpe = stmpe;