linux/drivers/platform/x86
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
..
amd platform/x86/amd/pmf: Register notify handler only if SPS is enabled 2023-06-28 11:12:34 +02:00
dell platform/x86/dell/dell-rbtn: Fix resources leaking on error path 2023-07-19 16:21:38 +02:00
hp platform/x86: hp-wmi: Fix cast to smaller integer type warning 2023-05-30 14:03:17 +01:00
intel platform/x86: ISST: Remove 8 socket limit 2023-05-30 14:03:22 +01:00
acer-wireless.c
acer-wmi.c
acerhdf.c
adv_swbutton.c
amilo-rfkill.c
apple-gmux.c platform/x86: apple-gmux: Add apple_gmux_detect() helper 2023-02-01 08:34:46 +01:00
asus-laptop.c
asus-nb-wmi.c platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0 2023-06-21 16:00:52 +02:00
asus-tf103c-dock.c
asus-wireless.c
asus-wmi.c platform/x86: asus-wmi: Fix kbd_dock_devid tablet-switch reporting 2023-02-01 08:34:46 +01:00
asus-wmi.h platform/x86: asus-wmi: Add quirk wmi_ignore_fan 2023-02-01 08:34:33 +01:00
barco-p50-gpio.c
classmate-laptop.c
compal-laptop.c
dual_accel_detect.h
eeepc-laptop.c
eeepc-wmi.c
firmware_attributes_class.c
firmware_attributes_class.h
fujitsu-laptop.c
fujitsu-tablet.c
gigabyte-wmi.c platform/x86: gigabyte-wmi: add support for X570S AORUS ELITE 2023-04-26 14:28:37 +02:00
gpd-pocket-fan.c
hdaps.c
huawei-wmi.c
ibm_rtl.c
ideapad-laptop.c platform/x86: ideapad-laptop: Stop sending KEY_TOUCHPAD_TOGGLE 2023-04-06 12:10:53 +02:00
intel_ips.c
intel_ips.h
intel_scu_ipc.c
intel_scu_ipcutil.c
intel_scu_pcidrv.c platform/x86: intel_scu_pcidrv: Add back PCI ID for Medfield 2023-06-09 10:34:08 +02:00
intel_scu_pltdrv.c
intel_scu_wdt.c
Kconfig platform/x86: Move existing HP drivers to a new hp subdir 2023-05-24 17:32:42 +01:00
lenovo-yogabook-wmi.c platform/x86: lenovo-yogabook: Set default keyboard backligh brightness on probe() 2023-07-19 16:21:35 +02:00
lg-laptop.c
Makefile platform/x86: Move existing HP drivers to a new hp subdir 2023-05-24 17:32:42 +01:00
meraki-mx100.c
mlx-platform.c
msi-laptop.c
msi-wmi.c
mxm-wmi.c
nvidia-wmi-ec-backlight.c platform/x86: nvidia-wmi-ec-backlight: Add force module parameter 2023-02-25 11:25:43 +01:00
p2sb.c
panasonic-laptop.c
pcengines-apuv2.c
peaq-wmi.c
pmc_atom.c
samsung-laptop.c
samsung-q10.c
serial-multi-instantiate.c
simatic-ipc.c platform/x86: simatic-ipc: add another model 2023-02-01 08:34:33 +01:00
sony-laptop.c platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during probe 2023-01-18 11:58:18 +01:00
system76_acpi.c
think-lmi.c platform/x86: think-lmi: Correct NVME password handling 2023-07-19 16:21:36 +02:00
think-lmi.h
thinkpad_acpi.c platform/x86: thinkpad_acpi: Fix lkp-tests warnings for platform profiles 2023-07-19 16:21:37 +02:00
topstar-laptop.c
toshiba_acpi.c
toshiba_bluetooth.c
toshiba_haps.c
toshiba-wmi.c
touchscreen_dmi.c platform/x86: touchscreen_dmi: Add info for the Dexp Ursus KX210i 2023-05-17 11:53:43 +02:00
uv_sysfs.c
winmate-fm07-keys.c
wireless-hotkey.c
wmi-bmof.c
wmi.c
x86-android-tablets.c platform/x86: x86-android-tablets: Add Acer Iconia One 7 B1-750 data 2023-05-24 17:32:34 +01:00
xiaomi-wmi.c
xo1-rfkill.c
xo15-ebook.c