提交 fdd92cf7 编写于 作者: S Sanjeev Chugh 提交者: Xie XiuQi

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: NSanjeev Chugh <sanjeev_chugh@mentor.com>
Fixes: a4891f10 ("Input: atmel_mxt_ts - zero terminate config firmware file")
Cc: stable@vger.kernel.org
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 b2c2b391
...@@ -1586,10 +1586,10 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *fw) ...@@ -1586,10 +1586,10 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *fw)
/* T7 config may have changed */ /* T7 config may have changed */
mxt_init_t7_power_cfg(data); mxt_init_t7_power_cfg(data);
release_raw:
kfree(cfg.raw);
release_mem: release_mem:
kfree(cfg.mem); kfree(cfg.mem);
release_raw:
kfree(cfg.raw);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册