mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Input: atmel_mxt_ts - don't try to free unallocated kernel memory
If the user attempts to update Atmel device with an invalid configuration
cfg file, error handling code is trying to free cfg file memory which is
not allocated yet hence results into kernel crash.
This patch fixes the order of memory free operations.
Signed-off-by: Sanjeev Chugh <[email protected]>
Fixes: a4891f1058 ("Input: atmel_mxt_ts - zero terminate config firmware file")
Cc: [email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
This commit is contained in:
parent
d52266fc74
commit
1e3c336ad8
1 changed files with 2 additions and 2 deletions
|
|
@ -1585,10 +1585,10 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *fw)
|
|||
/* T7 config may have changed */
|
||||
mxt_init_t7_power_cfg(data);
|
||||
|
||||
release_raw:
|
||||
kfree(cfg.raw);
|
||||
release_mem:
|
||||
kfree(cfg.mem);
|
||||
release_raw:
|
||||
kfree(cfg.raw);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue