]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Input: atmel_mxt_ts - don't try to free unallocated kernel memory
authorSanjeev Chugh <sanjeev_chugh@mentor.com>
Sat, 29 Dec 2018 01:04:31 +0000 (17:04 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jan 2019 16:45:54 +0000 (17:45 +0100)
commitc995d6d6a7bc39ee49ce208881861d4733937057
tree9eddfd3115660e0772606e2a870cfe4ce46eb274
parentf736abe1d1ead3d7cad713d421c431494be57d70
Input: atmel_mxt_ts - don't try to free unallocated kernel memory

commit 1e3c336ad8f40f88a8961c434640920fe35cc08b upstream.

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 <sanjeev_chugh@mentor.com>
Fixes: a4891f105837 ("Input: atmel_mxt_ts - zero terminate config firmware file")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/touchscreen/atmel_mxt_ts.c