All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/13] USB: chipidea: fix memory leak with using debugfs_lookup()
@ 2023-02-02 15:32 Greg Kroah-Hartman
  2023-02-02 15:32 ` [PATCH 02/13] USB: ULPI: " Greg Kroah-Hartman
                   ` (12 more replies)
  0 siblings, 13 replies; 26+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-02 15:32 UTC (permalink / raw)
  To: linux-usb; +Cc: Greg Kroah-Hartman, Peter Chen, 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: 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>
---
 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


^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2023-02-10  8:51 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-03  9:05   ` Heikki Krogerus
2023-02-02 15:32 ` [PATCH 03/13] USB: uhci: " Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 04/13] USB: sl811: " Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 05/13] USB: fotg210: " Greg Kroah-Hartman
2023-02-02 22:15   ` Linus Walleij
2023-02-02 15:32 ` [PATCH 06/13] USB: isp116x: " Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 07/13] USB: isp1362: " Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 08/13] USB: gadget: gr_udc: " Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 09/13] USB: gadget: bcm63xx_udc: " Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 10/13] USB: gadget: lpc32xx_udc: " Greg Kroah-Hartman
2023-02-02 15:32   ` Greg Kroah-Hartman
2023-02-02 16:24   ` Vladimir Zapolskiy
2023-02-02 16:24     ` Vladimir Zapolskiy
2023-02-02 15:32 ` [PATCH 11/13] USB: gadget: pxa25x_udc: " Greg Kroah-Hartman
2023-02-02 15:32   ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 12/13] USB: gadget: pxa27x_udc: " Greg Kroah-Hartman
2023-02-02 15:32   ` Greg Kroah-Hartman
2023-02-02 15:32 ` [PATCH 13/13] USB: gadget: s3c2410_udc: " Greg Kroah-Hartman
2023-02-02 15:32   ` Greg Kroah-Hartman
2023-02-03  8:20   ` Krzysztof Kozlowski
2023-02-03  8:20     ` Krzysztof Kozlowski
2023-02-06  9:57     ` Greg Kroah-Hartman
2023-02-06  9:57       ` Greg Kroah-Hartman
2023-02-10  8:51 ` [PATCH 01/13] USB: chipidea: " Peter Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.