1
linux/drivers/platform/x86/x86-android-tablets
Hans de Goede 2fae3129c0 platform/x86: x86-android-tablets: Fix use after free on platform_device_register() errors
x86_android_tablet_remove() frees the pdevs[] array, so it should not
be used after calling x86_android_tablet_remove().

When platform_device_register() fails, store the pdevs[x] PTR_ERR() value
into the local ret variable before calling x86_android_tablet_remove()
to avoid using pdevs[] after it has been freed.

Fixes: 5eba014120 ("platform/x86: x86-android-tablets: Add support for instantiating platform-devs")
Fixes: e2200d3f26 ("platform/x86: x86-android-tablets: Add gpio_keys support to x86_android_tablet_init()")
Cc: stable@vger.kernel.org
Reported-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
Closes: https://lore.kernel.org/platform-driver-x86/20240917120458.7300-1-a.burakov@rosalinux.ru/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241005130545.64136-1-hdegoede@redhat.com
2024-10-06 12:50:50 +02:00
..
asus.c platform/x86: x86-android-tablets: Fix spelling in the comments 2024-09-04 20:19:20 +02:00
core.c platform/x86: x86-android-tablets: Fix use after free on platform_device_register() errors 2024-10-06 12:50:50 +02:00
dmi.c hwmon fixes for v6.11-rc7 2024-09-05 16:57:36 +02:00
Kconfig platform/x86: x86-android-tablets: Fix spelling in the comments 2024-09-04 20:19:20 +02:00
lenovo.c platform/x86: x86-android-tablets: Fix spelling in the comments 2024-09-04 20:19:20 +02:00
Makefile platform/x86: x86-android-tablets: Move remaining tablets to other.c 2023-03-07 12:08:31 +01:00
other.c platform/x86: x86-android-tablets: Adjust Xiaomi Pad 2 bottom bezel touch buttons LED 2024-09-16 15:10:46 +02:00
shared-psy-info.c platform/x86: x86-android-tablets: Fix spelling in the comments 2024-09-04 20:19:20 +02:00
shared-psy-info.h platform/x86: x86-android-tablets: Move shared power-supply fw-nodes to a separate file 2023-03-07 12:08:31 +01:00
x86-android-tablets.h platform/x86: x86-android-tablets: Fix spelling in the comments 2024-09-04 20:19:20 +02:00