Input: stmpe-ts - return -ENOMEM if memory allocation fail
Subsystems (3)
PATCH v2 2/2 Input: stmpe-ts - return -ENOMEM if memory allocation fail
Signed-off-by Axel Lin <[email protected]>
---
Change since v1:
remove unneeded initialization of 'ret' variable
drivers/input/touchscreen/stmpe-ts.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/input/touchscreen/stmpe-ts.c +7 -3
@@ -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;
Signature · 1 line
1.7.0.4
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Acked-by Wolfram Sang <[email protected]>
Quoted 44 lines
---
Change since v1:
remove unneeded initialization of 'ret' variabledrivers/input/touchscreen/stmpe-ts.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)drivers/input/touchscreen/stmpe-ts.c +7
-3@@ -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;Signature · 1 line
1.7.0.4
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Quoted 5 lines · Wolfram Sang
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>Acked-by Wolfram Sang <[email protected]>
Applied, thank you.
Signature · 1 line
Dmitry