提交 3e372bc8 编写于 作者: J José Expósito 提交者: Zheng Zengkai

Input: atmel_mxt_ts - fix double free in mxt_read_info_block

stable inclusion
from stable-v5.10.89
commit bc674f1b2119fcf36ca28a5f8170307be70de333
bugzilla: 186140 https://gitee.com/openeuler/kernel/issues/I4S8HA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bc674f1b2119fcf36ca28a5f8170307be70de333

--------------------------------

commit 12f247ab upstream.

The "id_buf" buffer is stored in "data->raw_info_block" and freed by
"mxt_free_object_table" in case of error.

Return instead of jumping to avoid a double free.

Addresses-Coverity-ID: 1474582 ("Double free")
Fixes: 068bdb67 ("Input: atmel_mxt_ts - fix the firmware update")
Signed-off-by: NJosé Expósito <jose.exposito89@gmail.com>
Link: https://lore.kernel.org/r/20211212194257.68879-1-jose.exposito89@gmail.com
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: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 02f7da6d
...@@ -1839,7 +1839,7 @@ static int mxt_read_info_block(struct mxt_data *data) ...@@ -1839,7 +1839,7 @@ static int mxt_read_info_block(struct mxt_data *data)
if (error) { if (error) {
dev_err(&client->dev, "Error %d parsing object table\n", error); dev_err(&client->dev, "Error %d parsing object table\n", error);
mxt_free_object_table(data); mxt_free_object_table(data);
goto err_free_mem; return error;
} }
data->object_table = (struct mxt_object *)(id_buf + MXT_OBJECT_START); data->object_table = (struct mxt_object *)(id_buf + MXT_OBJECT_START);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册