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>
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);
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: