diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-09-02 22:54:27 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-09-05 15:09:12 -0400 |
commit | cdd194779b72fe6d5e1b5b67ef57a0fddbd60eac (patch) | |
tree | 999f398bac1e40138afe262368ff4febff7760aa /drivers/input/touchscreen | |
parent | 843cbfa74f1a443ce0def7fcc799803f34faa71c (diff) |
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')
-rw-r--r-- | drivers/input/touchscreen/stmpe-ts.c | 10 |
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) | |||
268 | struct stmpe_touch *ts; | 268 | struct stmpe_touch *ts; |
269 | struct input_dev *idev; | 269 | struct input_dev *idev; |
270 | struct stmpe_ts_platform_data *ts_pdata = NULL; | 270 | struct stmpe_ts_platform_data *ts_pdata = NULL; |
271 | int ret = 0; | 271 | int ret; |
272 | int ts_irq; | 272 | int ts_irq; |
273 | 273 | ||
274 | ts_irq = platform_get_irq_byname(pdev, "FIFO_TH"); | 274 | ts_irq = platform_get_irq_byname(pdev, "FIFO_TH"); |
@@ -276,12 +276,16 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev) | |||
276 | return ts_irq; | 276 | return ts_irq; |
277 | 277 | ||
278 | ts = kzalloc(sizeof(*ts), GFP_KERNEL); | 278 | ts = kzalloc(sizeof(*ts), GFP_KERNEL); |
279 | if (!ts) | 279 | if (!ts) { |
280 | ret = -ENOMEM; | ||
280 | goto err_out; | 281 | goto err_out; |
282 | } | ||
281 | 283 | ||
282 | idev = input_allocate_device(); | 284 | idev = input_allocate_device(); |
283 | if (!idev) | 285 | if (!idev) { |
286 | ret = -ENOMEM; | ||
284 | goto err_free_ts; | 287 | goto err_free_ts; |
288 | } | ||
285 | 289 | ||
286 | platform_set_drvdata(pdev, ts); | 290 | platform_set_drvdata(pdev, ts); |
287 | ts->stmpe = stmpe; | 291 | ts->stmpe = stmpe; |