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:55:36 +0000 (13:55 +0100)
commitdcbe69f4f743a938344b32e60531ea55355e0c08
tree8960e68c716273bc42a5436437bce92642ee8768
parent610373dd354f3d393aa3bdcab59f55024c16b5e5
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