mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
modules: cyttsp: fix memory leak
Fix a memory leak in the cyttsp capsense module. Change-Id: Ie8441cc9593bbc2d05be8438725c0ab903e63258 Signed-off-by: Ryan Lattrel <ryanl@motorola.com> Reviewed-on: https://gerrit.mot.com/1129408 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Konstantin Makariev <kmakariev@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
299d64680b
commit
919125f54c
1 changed files with 8 additions and 0 deletions
|
|
@ -503,6 +503,7 @@ int cycapsense_hssp_parse_hex(struct hssp_data *d, const u8 *src, int len)
|
|||
pr_err("%s: Error kzalloc (%d).\n", __func__,
|
||||
P4000_METADATA_SIZE);
|
||||
kfree(d->inf.data);
|
||||
kfree(d->inf.s_data);
|
||||
return -ENOMEM;
|
||||
}
|
||||
dst = d->inf.data; /*data always first in PSoC HEX*/
|
||||
|
|
@ -784,6 +785,10 @@ fw_upd_end:
|
|||
kfree(inf->s_data);
|
||||
inf->s_data = NULL;
|
||||
}
|
||||
if (inf->m_data != NULL) {
|
||||
kfree(inf->m_data);
|
||||
inf->m_data = NULL;
|
||||
}
|
||||
if (fw != NULL)
|
||||
release_firmware(fw);
|
||||
if (fw_name != NULL)
|
||||
|
|
@ -1353,6 +1358,9 @@ static int cyttsp_sar_remove(struct i2c_client *client)
|
|||
int i;
|
||||
|
||||
free_irq(client->irq, data);
|
||||
if(ctrl_data)
|
||||
cancel_work_sync(&ctrl_data->work);
|
||||
|
||||
for (i = 0; i < pdata->nsars; i++) {
|
||||
sensors_classdev_unregister(&sensors_capsensor_cdev[i]);
|
||||
input_unregister_device(data->input_dev[i]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue