]> Git Repo - linux.git/commitdiff
Input: atmel_mxt_ts - fix double free in mxt_read_info_block
authorJosé Expósito <[email protected]>
Mon, 13 Dec 2021 05:01:49 +0000 (21:01 -0800)
committerDmitry Torokhov <[email protected]>
Mon, 13 Dec 2021 05:08:59 +0000 (21:08 -0800)
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: 068bdb67ef74 ("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]>
drivers/input/touchscreen/atmel_mxt_ts.c

index 05de92c0293bca82889c7a94912e748368b8b1b6..eb66cd2689b7c64487910cacc75a97f231e804ef 100644 (file)
@@ -1882,7 +1882,7 @@ static int mxt_read_info_block(struct mxt_data *data)
        if (error) {
                dev_err(&client->dev, "Error %d parsing object table\n", error);
                mxt_free_object_table(data);
-               goto err_free_mem;
+               return error;
        }
 
        data->object_table = (struct mxt_object *)(id_buf + MXT_OBJECT_START);
This page took 0.057157 seconds and 4 git commands to generate.