Skip to content

Commit 209cdbd

Browse files
committed
misc: vmw_balloon: 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. Cc: Nadav Amit <[email protected]> Cc: VMware PV-Drivers Reviewers <[email protected]> Cc: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1dc7e37 commit 209cdbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/misc/vmw_balloon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@ static void __init vmballoon_debugfs_init(struct vmballoon *b)
17091709
static void __exit vmballoon_debugfs_exit(struct vmballoon *b)
17101710
{
17111711
static_key_disable(&balloon_stat_enabled.key);
1712-
debugfs_remove(debugfs_lookup("vmmemctl", NULL));
1712+
debugfs_lookup_and_remove("vmmemctl", NULL);
17131713
kfree(b->stats);
17141714
b->stats = NULL;
17151715
}

0 commit comments

Comments
 (0)