diff options
author | Ferruh Yigit <fery@cypress.com> | 2013-07-04 14:02:45 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-07-04 14:05:50 -0700 |
commit | 57961e3ba72f4a8a1aa52e978020ecc2ca03a79f (patch) | |
tree | 1b77eb5a6649dd9a09cf8f5b28ec926a73638448 | |
parent | 9ff9f6dab781371ccb658f7a8567223da3267da3 (diff) | |
download | op-kernel-dev-57961e3ba72f4a8a1aa52e978020ecc2ca03a79f.zip op-kernel-dev-57961e3ba72f4a8a1aa52e978020ecc2ca03a79f.tar.gz |
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>
-rw-r--r-- | drivers/input/touchscreen/cyttsp4_core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c index a7987e1..edcf799 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, cd->irq = gpio_to_irq(cd->cpdata->irq_gpio); if (cd->irq < 0) { rc = -EINVAL; - goto error_free_cd; + goto error_free_xfer; } dev_set_drvdata(dev, cd); @@ -2117,6 +2117,8 @@ error_request_irq: if (cd->cpdata->init) cd->cpdata->init(cd->cpdata, 0, dev); dev_set_drvdata(dev, NULL); +error_free_xfer: + kfree(cd->xfer_buf); error_free_cd: kfree(cd); error_alloc_data: |