Skip to content

Commit 57961e3

Browse files
Ferruh Yigitdtor
authored andcommitted
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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 9ff9f6d commit 57961e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/input/touchscreen/cyttsp4_core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ struct cyttsp4 *cyttsp4_probe(const struct cyttsp4_bus_ops *ops,
20492049
cd->irq = gpio_to_irq(cd->cpdata->irq_gpio);
20502050
if (cd->irq < 0) {
20512051
rc = -EINVAL;
2052-
goto error_free_cd;
2052+
goto error_free_xfer;
20532053
}
20542054

20552055
dev_set_drvdata(dev, cd);
@@ -2117,6 +2117,8 @@ struct cyttsp4 *cyttsp4_probe(const struct cyttsp4_bus_ops *ops,
21172117
if (cd->cpdata->init)
21182118
cd->cpdata->init(cd->cpdata, 0, dev);
21192119
dev_set_drvdata(dev, NULL);
2120+
error_free_xfer:
2121+
kfree(cd->xfer_buf);
21202122
error_free_cd:
21212123
kfree(cd);
21222124
error_alloc_data:

0 commit comments

Comments
 (0)