Skip to content

Commit 12f247a

Browse files
JoseExpositodtor
authored andcommitted
Input: atmel_mxt_ts - fix double free in mxt_read_info_block
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: 068bdb6 ("Input: atmel_mxt_ts - fix the firmware update") Signed-off-by: José Expósito <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 3fd6e12 commit 12f247a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/input/touchscreen/atmel_mxt_ts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ static int mxt_read_info_block(struct mxt_data *data)
18821882
if (error) {
18831883
dev_err(&client->dev, "Error %d parsing object table\n", error);
18841884
mxt_free_object_table(data);
1885-
goto err_free_mem;
1885+
return error;
18861886
}
18871887

18881888
data->object_table = (struct mxt_object *)(id_buf + MXT_OBJECT_START);

0 commit comments

Comments
 (0)