aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorFerruh Yigit <fery@cypress.com>2013-07-04 17:02:45 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-07-04 17:05:50 -0400
commit57961e3ba72f4a8a1aa52e978020ecc2ca03a79f (patch)
tree1b77eb5a6649dd9a09cf8f5b28ec926a73638448 /drivers/input
parent9ff9f6dab781371ccb658f7a8567223da3267da3 (diff)
Input: cyttsp4 - kfree xfer_buf on error path in probe()
If probe() fails after cd->xfer_buf allocated, it will not freed. Added kfree(cd->xfer_buf) with and error label. Signed-off-by: Ferruh Yigit <fery@cypress.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/cyttsp4_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
index a7987e170071..edcf7993034b 100644
--- a/drivers/input/touchscreen/cyttsp4_core.c
+++ b/drivers/input/touchscreen/cyttsp4_core.c
@@ -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_free_cd; 2052 goto error_free_xfer;
2053 } 2053 }
2054 2054
2055 dev_set_drvdata(dev, cd); 2055 dev_set_drvdata(dev, cd);
@@ -2117,6 +2117,8 @@ 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_free_xfer:
2121 kfree(cd->xfer_buf);
2120error_free_cd: 2122error_free_cd:
2121 kfree(cd); 2123 kfree(cd);
2122error_alloc_data: 2124error_alloc_data: