]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: ULPI: fix memory leak with using debugfs_lookup()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Feb 2023 15:32:24 +0000 (16:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:50:42 +0000 (13:50 +0100)
commit2b8aa879e28df11e45855b04788050c61fb6b02a
treee7de903bf1d13a1a4aa47ac8850bbf563d663408
parent972e0682f6e3ee6ecf002657df4aaa511d51dd6c
USB: ULPI: fix memory leak with using debugfs_lookup()

[ Upstream commit 8f4d25eba599c4bd4b5ea8ae8752cda480a9d563 ]

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.

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20230202153235.2412790-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/common/ulpi.c