Skip to content

Commit 1e3c336

Browse files
sanjeevcdtor
authored andcommitted
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: a4891f1 ("Input: atmel_mxt_ts - zero terminate config firmware file") Cc: [email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent d52266f commit 1e3c336

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/input/touchscreen/atmel_mxt_ts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,10 +1585,10 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *fw)
15851585
/* T7 config may have changed */
15861586
mxt_init_t7_power_cfg(data);
15871587

1588-
release_raw:
1589-
kfree(cfg.raw);
15901588
release_mem:
15911589
kfree(cfg.mem);
1590+
release_raw:
1591+
kfree(cfg.raw);
15921592
return ret;
15931593
}
15941594

0 commit comments

Comments
 (0)