* [PATCH 02/13] USB: ULPI: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-03 9:05 ` Heikki Krogerus
2023-02-02 15:32 ` [PATCH 03/13] USB: uhci: " Greg Kroah-Hartman
` (11 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb; +Cc: Greg Kroah-Hartman, Heikki Krogerus, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/common/ulpi.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
index 67b780b256a9..a98b2108376a 100644
--- a/drivers/usb/common/ulpi.c
+++ b/drivers/usb/common/ulpi.c
@@ -271,7 +271,7 @@ static int ulpi_regs_show(struct seq_file *seq, void *data)
}
DEFINE_SHOW_ATTRIBUTE(ulpi_regs);
-#define ULPI_ROOT debugfs_lookup(KBUILD_MODNAME, NULL)
+static struct dentry *ulpi_root;
static int ulpi_register(struct device *dev, struct ulpi *ulpi)
{
@@ -301,7 +301,7 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi)
return ret;
}
- root = debugfs_create_dir(dev_name(dev), ULPI_ROOT);
+ root = debugfs_create_dir(dev_name(dev), ulpi_root);
debugfs_create_file("regs", 0444, root, ulpi, &ulpi_regs_fops);
dev_dbg(&ulpi->dev, "registered ULPI PHY: vendor %04x, product %04x\n",
@@ -349,8 +349,7 @@ EXPORT_SYMBOL_GPL(ulpi_register_interface);
*/
void ulpi_unregister_interface(struct ulpi *ulpi)
{
- debugfs_remove_recursive(debugfs_lookup(dev_name(&ulpi->dev),
- ULPI_ROOT));
+ debugfs_lookup_and_remove(dev_name(&ulpi->dev), ulpi_root);
device_unregister(&ulpi->dev);
}
EXPORT_SYMBOL_GPL(ulpi_unregister_interface);
@@ -360,12 +359,11 @@ EXPORT_SYMBOL_GPL(ulpi_unregister_interface);
static int __init ulpi_init(void)
{
int ret;
- struct dentry *root;
- root = debugfs_create_dir(KBUILD_MODNAME, NULL);
+ ulpi_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
ret = bus_register(&ulpi_bus);
if (ret)
- debugfs_remove(root);
+ debugfs_remove(ulpi_root);
return ret;
}
subsys_initcall(ulpi_init);
@@ -373,7 +371,7 @@ subsys_initcall(ulpi_init);
static void __exit ulpi_exit(void)
{
bus_unregister(&ulpi_bus);
- debugfs_remove_recursive(ULPI_ROOT);
+ debugfs_remove(ulpi_root);
}
module_exit(ulpi_exit);
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 02/13] USB: ULPI: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 ` [PATCH 02/13] USB: ULPI: " Greg Kroah-Hartman
@ 2023-02-03 9:05 ` Heikki Krogerus
0 siblings, 0 replies; 26+ messages in thread
From: Heikki Krogerus @ 2023-02-03 9:05 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel
On Thu, Feb 02, 2023 at 04:32:24PM +0100, Greg Kroah-Hartman wrote:
> When calling debugfs_lookup() the result must have dput() called on it,
> otherwise the memory will leak over time. To make things simpler, just
> call debugfs_lookup_and_remove() instead which handles all of the logic
> at once.
>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/common/ulpi.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
> index 67b780b256a9..a98b2108376a 100644
> --- a/drivers/usb/common/ulpi.c
> +++ b/drivers/usb/common/ulpi.c
> @@ -271,7 +271,7 @@ static int ulpi_regs_show(struct seq_file *seq, void *data)
> }
> DEFINE_SHOW_ATTRIBUTE(ulpi_regs);
>
> -#define ULPI_ROOT debugfs_lookup(KBUILD_MODNAME, NULL)
> +static struct dentry *ulpi_root;
>
> static int ulpi_register(struct device *dev, struct ulpi *ulpi)
> {
> @@ -301,7 +301,7 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi)
> return ret;
> }
>
> - root = debugfs_create_dir(dev_name(dev), ULPI_ROOT);
> + root = debugfs_create_dir(dev_name(dev), ulpi_root);
> debugfs_create_file("regs", 0444, root, ulpi, &ulpi_regs_fops);
>
> dev_dbg(&ulpi->dev, "registered ULPI PHY: vendor %04x, product %04x\n",
> @@ -349,8 +349,7 @@ EXPORT_SYMBOL_GPL(ulpi_register_interface);
> */
> void ulpi_unregister_interface(struct ulpi *ulpi)
> {
> - debugfs_remove_recursive(debugfs_lookup(dev_name(&ulpi->dev),
> - ULPI_ROOT));
> + debugfs_lookup_and_remove(dev_name(&ulpi->dev), ulpi_root);
> device_unregister(&ulpi->dev);
> }
> EXPORT_SYMBOL_GPL(ulpi_unregister_interface);
> @@ -360,12 +359,11 @@ EXPORT_SYMBOL_GPL(ulpi_unregister_interface);
> static int __init ulpi_init(void)
> {
> int ret;
> - struct dentry *root;
>
> - root = debugfs_create_dir(KBUILD_MODNAME, NULL);
> + ulpi_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
> ret = bus_register(&ulpi_bus);
> if (ret)
> - debugfs_remove(root);
> + debugfs_remove(ulpi_root);
> return ret;
> }
> subsys_initcall(ulpi_init);
> @@ -373,7 +371,7 @@ subsys_initcall(ulpi_init);
> static void __exit ulpi_exit(void)
> {
> bus_unregister(&ulpi_bus);
> - debugfs_remove_recursive(ULPI_ROOT);
> + debugfs_remove(ulpi_root);
> }
> module_exit(ulpi_exit);
>
> --
> 2.39.1
--
heikki
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 03/13] USB: uhci: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 02/13] USB: ULPI: " Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 04/13] USB: sl811: " Greg Kroah-Hartman
` (10 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb; +Cc: Greg Kroah-Hartman, Alan Stern, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/uhci-hcd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index c22b51af83fc..7cdc2fa7c28f 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -536,8 +536,8 @@ static void release_uhci(struct uhci_hcd *uhci)
uhci->is_initialized = 0;
spin_unlock_irq(&uhci->lock);
- debugfs_remove(debugfs_lookup(uhci_to_hcd(uhci)->self.bus_name,
- uhci_debugfs_root));
+ debugfs_lookup_and_remove(uhci_to_hcd(uhci)->self.bus_name,
+ uhci_debugfs_root);
for (i = 0; i < UHCI_NUM_SKELQH; i++)
uhci_free_qh(uhci, uhci->skelqh[i]);
@@ -700,7 +700,7 @@ static int uhci_start(struct usb_hcd *hcd)
uhci->frame, uhci->frame_dma_handle);
err_alloc_frame:
- debugfs_remove(debugfs_lookup(hcd->self.bus_name, uhci_debugfs_root));
+ debugfs_lookup_and_remove(hcd->self.bus_name, uhci_debugfs_root);
return retval;
}
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 04/13] USB: sl811: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 02/13] USB: ULPI: " Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 03/13] USB: uhci: " Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 05/13] USB: fotg210: " Greg Kroah-Hartman
` (9 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb; +Cc: Greg Kroah-Hartman, Vincent Mailhol, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/sl811-hcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index d206bd95c7bb..b8b90eec9107 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1501,7 +1501,7 @@ static void create_debug_file(struct sl811 *sl811)
static void remove_debug_file(struct sl811 *sl811)
{
- debugfs_remove(debugfs_lookup("sl811h", usb_debug_root));
+ debugfs_lookup_and_remove("sl811h", usb_debug_root);
}
/*-------------------------------------------------------------------------*/
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 05/13] USB: fotg210: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
` (2 preceding siblings ...)
2023-02-02 15:32 ` [PATCH 04/13] USB: sl811: " Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 22:15 ` Linus Walleij
2023-02-02 15:32 ` [PATCH 06/13] USB: isp116x: " Greg Kroah-Hartman
` (8 subsequent siblings)
12 siblings, 1 reply; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb; +Cc: Greg Kroah-Hartman, Linus Walleij, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/fotg210/fotg210-hcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c
index 51ac93a2eb98..1c5eb8f8c19c 100644
--- a/drivers/usb/fotg210/fotg210-hcd.c
+++ b/drivers/usb/fotg210/fotg210-hcd.c
@@ -862,7 +862,7 @@ static inline void remove_debug_files(struct fotg210_hcd *fotg210)
{
struct usb_bus *bus = &fotg210_to_hcd(fotg210)->self;
- debugfs_remove(debugfs_lookup(bus->bus_name, fotg210_debug_root));
+ debugfs_lookup_and_remove(bus->bus_name, fotg210_debug_root);
}
/* handshake - spin reading hc until handshake completes or fails
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 05/13] USB: fotg210: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 ` [PATCH 05/13] USB: fotg210: " Greg Kroah-Hartman
@ 2023-02-02 22:15 ` Linus Walleij
0 siblings, 0 replies; 26+ messages in thread
From: Linus Walleij @ 2023-02-02 22:15 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel
On Thu, Feb 2, 2023 at 4:33 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> When calling debugfs_lookup() the result must have dput() called on it,
> otherwise the memory will leak over time. To make things simpler, just
> call debugfs_lookup_and_remove() instead which handles all of the logic
> at once.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thanks Greg!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 06/13] USB: isp116x: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
` (3 preceding siblings ...)
2023-02-02 15:32 ` [PATCH 05/13] USB: fotg210: " Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 07/13] USB: isp1362: " Greg Kroah-Hartman
` (7 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb; +Cc: Greg Kroah-Hartman, Olav Kongas, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Olav Kongas <ok@artecdesign.ee>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/isp116x-hcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 4f564d71bb0b..49ae01487af4 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1205,7 +1205,7 @@ static void create_debug_file(struct isp116x *isp116x)
static void remove_debug_file(struct isp116x *isp116x)
{
- debugfs_remove(debugfs_lookup(hcd_name, usb_debug_root));
+ debugfs_lookup_and_remove(hcd_name, usb_debug_root);
}
#else
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 07/13] USB: isp1362: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
` (4 preceding siblings ...)
2023-02-02 15:32 ` [PATCH 06/13] USB: isp116x: " Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 08/13] USB: gadget: gr_udc: " Greg Kroah-Hartman
` (6 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb; +Cc: Greg Kroah-Hartman, Vincent Mailhol, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/isp1362-hcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index 0e14d1d07709..b0da143ef4be 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -2170,7 +2170,7 @@ static void create_debug_file(struct isp1362_hcd *isp1362_hcd)
static void remove_debug_file(struct isp1362_hcd *isp1362_hcd)
{
- debugfs_remove(debugfs_lookup("isp1362", usb_debug_root));
+ debugfs_lookup_and_remove("isp1362", usb_debug_root);
}
/*-------------------------------------------------------------------------*/
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 08/13] USB: gadget: gr_udc: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
` (5 preceding siblings ...)
2023-02-02 15:32 ` [PATCH 07/13] USB: isp1362: " Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 09/13] USB: gadget: bcm63xx_udc: " Greg Kroah-Hartman
` (5 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb; +Cc: Greg Kroah-Hartman, Jakob Koschel, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Jakob Koschel <jakobkoschel@gmail.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/gr_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c
index 22096f8505de..52c12c96c275 100644
--- a/drivers/usb/gadget/udc/gr_udc.c
+++ b/drivers/usb/gadget/udc/gr_udc.c
@@ -215,7 +215,7 @@ static void gr_dfs_create(struct gr_udc *dev)
static void gr_dfs_delete(struct gr_udc *dev)
{
- debugfs_remove(debugfs_lookup(dev_name(dev->dev), usb_debug_root));
+ debugfs_lookup_and_remove(dev_name(dev->dev), usb_debug_root);
}
#else /* !CONFIG_USB_GADGET_DEBUG_FS */
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 09/13] USB: gadget: bcm63xx_udc: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
` (6 preceding siblings ...)
2023-02-02 15:32 ` [PATCH 08/13] USB: gadget: gr_udc: " Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` Greg Kroah-Hartman
` (4 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb; +Cc: Greg Kroah-Hartman, Kevin Cernekee, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/bcm63xx_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c
index 2cdb07905bde..90cf78aa65df 100644
--- a/drivers/usb/gadget/udc/bcm63xx_udc.c
+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
@@ -2259,7 +2259,7 @@ static void bcm63xx_udc_init_debugfs(struct bcm63xx_udc *udc)
*/
static void bcm63xx_udc_cleanup_debugfs(struct bcm63xx_udc *udc)
{
- debugfs_remove(debugfs_lookup(udc->gadget.name, usb_debug_root));
+ debugfs_lookup_and_remove(udc->gadget.name, usb_debug_root);
}
/***********************************************************************
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 10/13] USB: gadget: lpc32xx_udc: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 03/13] USB: uhci: " Greg Kroah-Hartman
` (11 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb
Cc: Greg Kroah-Hartman, Vladimir Zapolskiy, Jakob Koschel,
Miaoqian Lin, linux-arm-kernel, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: Jakob Koschel <jakobkoschel@gmail.com>
Cc: Miaoqian Lin <linmq006@gmail.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c
index cea10cdb83ae..fe62db32dd0e 100644
--- a/drivers/usb/gadget/udc/lpc32xx_udc.c
+++ b/drivers/usb/gadget/udc/lpc32xx_udc.c
@@ -532,7 +532,7 @@ static void create_debug_file(struct lpc32xx_udc *udc)
static void remove_debug_file(struct lpc32xx_udc *udc)
{
- debugfs_remove(debugfs_lookup(debug_filename, NULL));
+ debugfs_lookup_and_remove(debug_filename, NULL);
}
#else
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 10/13] USB: gadget: lpc32xx_udc: fix memory leak with using debugfs_lookup()
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
0 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb
Cc: Greg Kroah-Hartman, Vladimir Zapolskiy, Jakob Koschel,
Miaoqian Lin, linux-arm-kernel, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: Jakob Koschel <jakobkoschel@gmail.com>
Cc: Miaoqian Lin <linmq006@gmail.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c
index cea10cdb83ae..fe62db32dd0e 100644
--- a/drivers/usb/gadget/udc/lpc32xx_udc.c
+++ b/drivers/usb/gadget/udc/lpc32xx_udc.c
@@ -532,7 +532,7 @@ static void create_debug_file(struct lpc32xx_udc *udc)
static void remove_debug_file(struct lpc32xx_udc *udc)
{
- debugfs_remove(debugfs_lookup(debug_filename, NULL));
+ debugfs_lookup_and_remove(debug_filename, NULL);
}
#else
--
2.39.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 10/13] USB: gadget: lpc32xx_udc: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 ` Greg Kroah-Hartman
@ 2023-02-02 16:24 ` Vladimir Zapolskiy
-1 siblings, 0 replies; 26+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-02 16:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-usb
Cc: Jakob Koschel, Miaoqian Lin, linux-arm-kernel, linux-kernel
On 2/2/23 17:32, Greg Kroah-Hartman wrote:
> When calling debugfs_lookup() the result must have dput() called on it,
> otherwise the memory will leak over time. To make things simpler, just
> call debugfs_lookup_and_remove() instead which handles all of the logic
> at once.
>
> Cc: Vladimir Zapolskiy <vz@mleia.com>
> Cc: Jakob Koschel <jakobkoschel@gmail.com>
> Cc: Miaoqian Lin <linmq006@gmail.com>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
--
Best wishes,
Vladimir
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 10/13] USB: gadget: lpc32xx_udc: fix memory leak with using debugfs_lookup()
@ 2023-02-02 16:24 ` Vladimir Zapolskiy
0 siblings, 0 replies; 26+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-02 16:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-usb
Cc: Jakob Koschel, Miaoqian Lin, linux-arm-kernel, linux-kernel
On 2/2/23 17:32, Greg Kroah-Hartman wrote:
> When calling debugfs_lookup() the result must have dput() called on it,
> otherwise the memory will leak over time. To make things simpler, just
> call debugfs_lookup_and_remove() instead which handles all of the logic
> at once.
>
> Cc: Vladimir Zapolskiy <vz@mleia.com>
> Cc: Jakob Koschel <jakobkoschel@gmail.com>
> Cc: Miaoqian Lin <linmq006@gmail.com>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
--
Best wishes,
Vladimir
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 11/13] USB: gadget: pxa25x_udc: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 03/13] USB: uhci: " Greg Kroah-Hartman
` (11 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb
Cc: Greg Kroah-Hartman, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
linux-arm-kernel, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/pxa25x_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
index c593fc383481..9e01ddf2b417 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -1340,7 +1340,7 @@ DEFINE_SHOW_ATTRIBUTE(udc_debug);
debugfs_create_file(dev->gadget.name, \
S_IRUGO, NULL, dev, &udc_debug_fops); \
} while (0)
-#define remove_debug_files(dev) debugfs_remove(debugfs_lookup(dev->gadget.name, NULL))
+#define remove_debug_files(dev) debugfs_lookup_and_remove(dev->gadget.name, NULL)
#else /* !CONFIG_USB_GADGET_DEBUG_FILES */
--
2.39.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 11/13] USB: gadget: pxa25x_udc: fix memory leak with using debugfs_lookup()
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
0 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb
Cc: Greg Kroah-Hartman, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
linux-arm-kernel, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/pxa25x_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
index c593fc383481..9e01ddf2b417 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -1340,7 +1340,7 @@ DEFINE_SHOW_ATTRIBUTE(udc_debug);
debugfs_create_file(dev->gadget.name, \
S_IRUGO, NULL, dev, &udc_debug_fops); \
} while (0)
-#define remove_debug_files(dev) debugfs_remove(debugfs_lookup(dev->gadget.name, NULL))
+#define remove_debug_files(dev) debugfs_lookup_and_remove(dev->gadget.name, NULL)
#else /* !CONFIG_USB_GADGET_DEBUG_FILES */
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 12/13] USB: gadget: pxa27x_udc: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 03/13] USB: uhci: " Greg Kroah-Hartman
` (11 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb
Cc: Greg Kroah-Hartman, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
linux-arm-kernel, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index ac980d6a4740..0ecdfd2ba9e9 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -215,7 +215,7 @@ static void pxa_init_debugfs(struct pxa_udc *udc)
static void pxa_cleanup_debugfs(struct pxa_udc *udc)
{
- debugfs_remove(debugfs_lookup(udc->gadget.name, usb_debug_root));
+ debugfs_lookup_and_remove(udc->gadget.name, usb_debug_root);
}
#else
--
2.39.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 12/13] USB: gadget: pxa27x_udc: fix memory leak with using debugfs_lookup()
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
0 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb
Cc: Greg Kroah-Hartman, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
linux-arm-kernel, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index ac980d6a4740..0ecdfd2ba9e9 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -215,7 +215,7 @@ static void pxa_init_debugfs(struct pxa_udc *udc)
static void pxa_cleanup_debugfs(struct pxa_udc *udc)
{
- debugfs_remove(debugfs_lookup(udc->gadget.name, usb_debug_root));
+ debugfs_lookup_and_remove(udc->gadget.name, usb_debug_root);
}
#else
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 13/13] USB: gadget: s3c2410_udc: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 03/13] USB: uhci: " Greg Kroah-Hartman
` (11 subsequent siblings)
12 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb
Cc: Greg Kroah-Hartman, Krzysztof Kozlowski, Alim Akhtar,
Linus Walleij, Jakob Koschel, linux-arm-kernel,
linux-samsung-soc, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Jakob Koschel <jakobkoschel@gmail.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/s3c2410_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c
index 8c57b191e52b..3525a3c260a7 100644
--- a/drivers/usb/gadget/udc/s3c2410_udc.c
+++ b/drivers/usb/gadget/udc/s3c2410_udc.c
@@ -1881,7 +1881,7 @@ static int s3c2410_udc_remove(struct platform_device *pdev)
return -EBUSY;
usb_del_gadget_udc(&udc->gadget);
- debugfs_remove(debugfs_lookup("registers", s3c2410_udc_debugfs_root));
+ debugfs_lookup_and_remove("registers", s3c2410_udc_debugfs_root);
if (udc->vbus_gpiod)
free_irq(gpiod_to_irq(udc->vbus_gpiod), udc);
--
2.39.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 13/13] USB: gadget: s3c2410_udc: fix memory leak with using debugfs_lookup()
@ 2023-02-02 15:32 ` Greg Kroah-Hartman
0 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
To: linux-usb
Cc: Greg Kroah-Hartman, Krzysztof Kozlowski, Alim Akhtar,
Linus Walleij, Jakob Koschel, linux-arm-kernel,
linux-samsung-soc, linux-kernel
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time. To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Jakob Koschel <jakobkoschel@gmail.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/udc/s3c2410_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c
index 8c57b191e52b..3525a3c260a7 100644
--- a/drivers/usb/gadget/udc/s3c2410_udc.c
+++ b/drivers/usb/gadget/udc/s3c2410_udc.c
@@ -1881,7 +1881,7 @@ static int s3c2410_udc_remove(struct platform_device *pdev)
return -EBUSY;
usb_del_gadget_udc(&udc->gadget);
- debugfs_remove(debugfs_lookup("registers", s3c2410_udc_debugfs_root));
+ debugfs_lookup_and_remove("registers", s3c2410_udc_debugfs_root);
if (udc->vbus_gpiod)
free_irq(gpiod_to_irq(udc->vbus_gpiod), udc);
--
2.39.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 13/13] USB: gadget: s3c2410_udc: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 ` Greg Kroah-Hartman
@ 2023-02-03 8:20 ` Krzysztof Kozlowski
-1 siblings, 0 replies; 26+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-03 8:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-usb
Cc: Alim Akhtar, Linus Walleij, Jakob Koschel, linux-arm-kernel,
linux-samsung-soc, linux-kernel, Arnd Bergmann
On 02/02/2023 16:32, Greg Kroah-Hartman wrote:
> When calling debugfs_lookup() the result must have dput() called on it,
> otherwise the memory will leak over time. To make things simpler, just
> call debugfs_lookup_and_remove() instead which handles all of the logic
> at once.
>
Hi Greg,
This driver will be removed in v6.3 via Arnd's tree:
https://lore.kernel.org/all/20221021203329.4143397-13-arnd@kernel.org/
I think we can skip any work on this.
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 13/13] USB: gadget: s3c2410_udc: fix memory leak with using debugfs_lookup()
@ 2023-02-03 8:20 ` Krzysztof Kozlowski
0 siblings, 0 replies; 26+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-03 8:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-usb
Cc: Alim Akhtar, Linus Walleij, Jakob Koschel, linux-arm-kernel,
linux-samsung-soc, linux-kernel, Arnd Bergmann
On 02/02/2023 16:32, Greg Kroah-Hartman wrote:
> When calling debugfs_lookup() the result must have dput() called on it,
> otherwise the memory will leak over time. To make things simpler, just
> call debugfs_lookup_and_remove() instead which handles all of the logic
> at once.
>
Hi Greg,
This driver will be removed in v6.3 via Arnd's tree:
https://lore.kernel.org/all/20221021203329.4143397-13-arnd@kernel.org/
I think we can skip any work on this.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 13/13] USB: gadget: s3c2410_udc: fix memory leak with using debugfs_lookup()
2023-02-03 8:20 ` Krzysztof Kozlowski
@ 2023-02-06 9:57 ` Greg Kroah-Hartman
-1 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-06 9:57 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: linux-usb, Alim Akhtar, Linus Walleij, Jakob Koschel,
linux-arm-kernel, linux-samsung-soc, linux-kernel, Arnd Bergmann
On Fri, Feb 03, 2023 at 09:20:10AM +0100, Krzysztof Kozlowski wrote:
> On 02/02/2023 16:32, Greg Kroah-Hartman wrote:
> > When calling debugfs_lookup() the result must have dput() called on it,
> > otherwise the memory will leak over time. To make things simpler, just
> > call debugfs_lookup_and_remove() instead which handles all of the logic
> > at once.
> >
>
> Hi Greg,
>
> This driver will be removed in v6.3 via Arnd's tree:
> https://lore.kernel.org/all/20221021203329.4143397-13-arnd@kernel.org/
>
> I think we can skip any work on this.
Ok, thanks, I'll drop it from my patch queue for now. If it sticks
around, I'll apply it :)
greg k-h
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 13/13] USB: gadget: s3c2410_udc: fix memory leak with using debugfs_lookup()
@ 2023-02-06 9:57 ` Greg Kroah-Hartman
0 siblings, 0 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-06 9:57 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: linux-usb, Alim Akhtar, Linus Walleij, Jakob Koschel,
linux-arm-kernel, linux-samsung-soc, linux-kernel, Arnd Bergmann
On Fri, Feb 03, 2023 at 09:20:10AM +0100, Krzysztof Kozlowski wrote:
> On 02/02/2023 16:32, Greg Kroah-Hartman wrote:
> > When calling debugfs_lookup() the result must have dput() called on it,
> > otherwise the memory will leak over time. To make things simpler, just
> > call debugfs_lookup_and_remove() instead which handles all of the logic
> > at once.
> >
>
> Hi Greg,
>
> This driver will be removed in v6.3 via Arnd's tree:
> https://lore.kernel.org/all/20221021203329.4143397-13-arnd@kernel.org/
>
> I think we can skip any work on this.
Ok, thanks, I'll drop it from my patch queue for now. If it sticks
around, I'll apply it :)
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup()
2023-02-02 15:32 [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup() Greg Kroah-Hartman
` (11 preceding siblings ...)
2023-02-02 15:32 ` Greg Kroah-Hartman
@ 2023-02-10 8:51 ` Peter Chen
12 siblings, 0 replies; 26+ messages in thread
From: Peter Chen @ 2023-02-10 8:51 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel
On 23-02-02 16:32:23, Greg Kroah-Hartman wrote:
> When calling debugfs_lookup() the result must have dput() called on it,
> otherwise the memory will leak over time. To make things simpler, just
> call debugfs_lookup_and_remove() instead which handles all of the logic
> at once.
>
> Cc: Peter Chen <peter.chen@kernel.org>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Peter Chen <peter.chen@kernel.org>
> ---
> drivers/usb/chipidea/debug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
> index faf6b078b6c4..bbc610e5bd69 100644
> --- a/drivers/usb/chipidea/debug.c
> +++ b/drivers/usb/chipidea/debug.c
> @@ -364,5 +364,5 @@ void dbg_create_files(struct ci_hdrc *ci)
> */
> void dbg_remove_files(struct ci_hdrc *ci)
> {
> - debugfs_remove(debugfs_lookup(dev_name(ci->dev), usb_debug_root));
> + debugfs_lookup_and_remove(dev_name(ci->dev), usb_debug_root);
> }
> --
> 2.39.1
>
--
Thanks,
Peter Chen
^ permalink raw reply [flat|nested] 26+ messages in thread