aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-07-02 23:32:58 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-07-02 23:39:24 -0400
commit394fc05b7967a043e26b4343011a319390801c8b (patch)
tree99b636a26f41ca30f4f14db3b1c0e503c2e1ed77 /drivers/input
parent7c4c018aadadf1db2c27d6b9f0280700a2619861 (diff)
Input: cyttsp4 - leak on error path in probe()
We leak "cd" if the cd->xfer_buf allocation fails. It was weird to "goto error_gpio_irq" so I changed the label name. (Label names should reflect the label location not the goto location otherwise you get an "all roads lead to Rome problem"). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/cyttsp4_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
index 851e3ff80437..a7987e170071 100644
--- a/drivers/input/touchscreen/cyttsp4_core.c
+++ b/drivers/input/touchscreen/cyttsp4_core.c
@@ -2025,7 +2025,7 @@ struct cyttsp4 *cyttsp4_probe(const struct cyttsp4_bus_ops *ops,
2025 if (!cd->xfer_buf) { 2025 if (!cd->xfer_buf) {
2026 dev_err(dev, "%s: Error, kzalloc\n", __func__); 2026 dev_err(dev, "%s: Error, kzalloc\n", __func__);
2027 rc = -ENOMEM; 2027 rc = -ENOMEM;
2028 goto error_alloc_data; 2028 goto error_free_cd;
2029 } 2029 }
2030 2030
2031 /* Initialize device info */ 2031 /* Initialize device info */
@@ -2049,7 +2049,7 @@ struct cyttsp4 *cyttsp4_probe(const struct cyttsp4_bus_ops *ops,
2049 cd->irq = gpio_to_irq(cd->cpdata->irq_gpio); 2049 cd->irq = gpio_to_irq(cd->cpdata->irq_gpio);
2050 if (cd->irq < 0) { 2050 if (cd->irq < 0) {
2051 rc = -EINVAL; 2051 rc = -EINVAL;
2052 goto error_gpio_irq; 2052 goto error_free_cd;
2053 } 2053 }
2054 2054
2055 dev_set_drvdata(dev, cd); 2055 dev_set_drvdata(dev, cd);
@@ -2117,7 +2117,7 @@ error_request_irq:
2117 if (cd->cpdata->init) 2117 if (cd->cpdata->init)
2118 cd->cpdata->init(cd->cpdata, 0, dev); 2118 cd->cpdata->init(cd->cpdata, 0, dev);
2119 dev_set_drvdata(dev, NULL); 2119 dev_set_drvdata(dev, NULL);
2120error_gpio_irq: 2120error_free_cd:
2121 kfree(cd); 2121 kfree(cd);
2122error_alloc_data: 2122error_alloc_data:
2123error_no_pdata: 2123error_no_pdata: