]> git.baikalelectronics.ru Git - kernel.git/commit
USB: gadget: bcm63xx_udc: fix memory leak with using debugfs_lookup()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Feb 2023 15:32:31 +0000 (16:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:37 +0000 (13:55 +0100)
commitc684daade37270de2bd7fffc42c14a76dcf84313
tree9cd97c1a2c4e91fcd4611a1c928e3d2012dbcc2b
parent517170385da384bada5e0aa96559a79a4621ee5c
USB: gadget: bcm63xx_udc: fix memory leak with using debugfs_lookup()

[ Upstream commit db740599c4216c0353e8789c64091762a91a446a ]

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>
Link: https://lore.kernel.org/r/20230202153235.2412790-9-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/udc/bcm63xx_udc.c