kernel/time/test_udelay.c: fix memory leak with using debugfs_lookup()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Feb 2023 15:12:14 +0000 (16:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Feb 2023 12:35:51 +0000 (13:35 +0100)
commit5f5139974c2030e0937d3ae01f17da1238281f11
tree046adb8a4deb4e2375338b0770543b075dad3649
parent862f6a84d1bf01435fdd6aa8b2811c88ab1f06f4
kernel/time/test_udelay.c: fix memory leak with using debugfs_lookup()

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.

Link: https://lore.kernel.org/r/20230202151214.2306822-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/time/test_udelay.c