Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5525d80d authored by José Expósito's avatar José Expósito Committed by Greg Kroah-Hartman
Browse files

Input: atmel_mxt_ts - fix double free in mxt_read_info_block



commit 12f247ab590a08856441efdbd351cf2cc8f60a2d 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: default avatarJosé 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: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 737a98d9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1794,7 +1794,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);