FAILED: patch "[PATCH] gpio: mockup: fix resource leak in error path" failed to apply to 4.14-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 1b02d9e770cd7087f34c743f85ccf5ea8372b047 Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <[email protected]>
Date: Tue, 8 Sep 2020 15:07:49 +0200
Subject: [PATCH] gpio: mockup: fix resource leak in error path
If the module init function fails after creating the debugs directory, it's never removed. Add proper cleanup calls to avoid this resource leak.
drivers/gpio/gpio-mockup.c +2 -0
@@ -552,6 +552,7 @@ static int __init gpio_mockup_init(void) err =platform_driver_register (&gpio_mockup_driver);if (err) {gpio_mockup_err ("error registering platform driver\n" ); +debugfs_remove_recursive (gpio_mockup_dbg_dir);return err; }
@@ -582,6 +583,7 @@ static int __init gpio_mockup_init(void)gpio_mockup_err ("error registering device" );platform_driver_unregister (&gpio_mockup_driver);gpio_mockup_unregister_pdevs (); +debugfs_remove_recursive (gpio_mockup_dbg_dir);return PTR_ERR (pdev); }
Sudip Mukherjee
Reviewed-by Andy ShevchenkoHi Greg,
Quoted 5 lines · On Sun, Oct 04, 2020 at 12:37:11PM +0200, [email protected] wrote:
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Here is the backport. Please consider for 4.14-stable.
--
Regards
Sudip
From 9c0dde685fd7e37a444a927fb9c9aca740444816 Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <[email protected]>
Date: Tue, 8 Sep 2020 15:07:49 +0200
Subject: [PATCH] gpio: mockup: fix resource leak in error path
commit 1b02d9e770cd7087f34c743f85ccf5ea8372b047 upstream
If the module init function fails after creating the debugs directory, it's never removed. Add proper cleanup calls to avoid this resource leak.
--- drivers/gpio/gpio-mockup.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-mockup.c +1 -0
@@ -350,6 +350,7 @@ static int __init mock_device_init(void) err =platform_driver_register (&gpio_mockup_driver);if (err) {platform_device_unregister (pdev); +debugfs_remove_recursive (gpio_mockup_dbg_dir);return err; }
Signature · 1 line
2.11.0
Greg KH
maintainerQuoted 10 lines · Sudip Mukherjee
Hi Greg,
Quoted 5 lines · On Sun, Oct 04, 2020 at 12:37:11PM +0200, [email protected] wrote:
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.Here is the backport. Please consider for 4.14-stable.
Now queued up, thanks.
greg k-h