Commit cdd19477 authored by Axel Lin's avatar Axel Lin Committed by Dmitry Torokhov

Input: stmpe-ts - return -ENOMEM when memory allocation fails

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 843cbfa7
...@@ -268,7 +268,7 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev) ...@@ -268,7 +268,7 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
struct stmpe_touch *ts; struct stmpe_touch *ts;
struct input_dev *idev; struct input_dev *idev;
struct stmpe_ts_platform_data *ts_pdata = NULL; struct stmpe_ts_platform_data *ts_pdata = NULL;
int ret = 0; int ret;
int ts_irq; int ts_irq;
ts_irq = platform_get_irq_byname(pdev, "FIFO_TH"); ts_irq = platform_get_irq_byname(pdev, "FIFO_TH");
...@@ -276,12 +276,16 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev) ...@@ -276,12 +276,16 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
return ts_irq; return ts_irq;
ts = kzalloc(sizeof(*ts), GFP_KERNEL); ts = kzalloc(sizeof(*ts), GFP_KERNEL);
if (!ts) if (!ts) {
ret = -ENOMEM;
goto err_out; goto err_out;
}
idev = input_allocate_device(); idev = input_allocate_device();
if (!idev) if (!idev) {
ret = -ENOMEM;
goto err_free_ts; goto err_free_ts;
}
platform_set_drvdata(pdev, ts); platform_set_drvdata(pdev, ts);
ts->stmpe = stmpe; ts->stmpe = stmpe;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment