acrn-kernel/drivers/platform
Michal Wilczynski c94376dbd6 platform/x86/dell/dell-rbtn: Fix resources leaking on error path
[ Upstream commit 966cca72ab ]

Currently rbtn_add() in case of failure is leaking resources. Fix this
by adding a proper rollback. Move devm_kzalloc() before rbtn_acquire(),
so it doesn't require rollback in case of failure. While at it, remove
unnecessary assignment of NULL to device->driver_data and unnecessary
whitespace, plus add a break for the default case in a switch.

Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Suggested-by: Pali Rohár <pali@kernel.org>
Fixes: 817a5cdb40 ("dell-rbtn: Dell Airplane Mode Switch driver")
Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20230613084310.2775896-1-michal.wilczynski@intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-19 16:21:38 +02:00
..
chrome
goldfish
loongarch
mellanox
mips
olpc
surface platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem 2023-06-14 11:15:15 +02:00
x86 platform/x86/dell/dell-rbtn: Fix resources leaking on error path 2023-07-19 16:21:38 +02:00
Kconfig
Makefile