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

Commit 783c1c50 authored by Rustam Subkhankulov's avatar Rustam Subkhankulov Committed by Greg Kroah-Hartman
Browse files

platform/chrome: fix double-free in chromeos_laptop_prepare()



[ Upstream commit 6ad4194d6a1e1d11b285989cd648ef695b4a93c0 ]

If chromeos_laptop_prepare_i2c_peripherals() fails after allocating memory
for 'cros_laptop->i2c_peripherals', this memory is freed at 'err_out' label
and nonzero value is returned. Then chromeos_laptop_destroy() is called,
resulting in double-free error.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: default avatarRustam Subkhankulov <subkhankulov@ispras.ru>
Fixes: 5020cd29 ("platform/chrome: chromeos_laptop - supply properties for ACPI devices")
Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220813220843.2373004-1-subkhankulov@ispras.ru


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 8242167c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment