Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platform/x86/dell/dell-rbtn: Fix resources leaking on error path
[ Upstream commit 966cca7 ] 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 <[email protected]> Suggested-by: Pali Rohár <[email protected]> Fixes: 817a5cd ("dell-rbtn: Dell Airplane Mode Switch driver") Signed-off-by: Michal Wilczynski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Pali Rohár <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
- Loading branch information