]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
misc: vmw_balloon: fix memory leak with using debugfs_lookup()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Feb 2023 14:11:00 +0000 (15:11 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:48:01 +0000 (16:48 +0100)
commit82318ba08eb3fd8790435eef7fb31215f350ef2a
tree4336c521e45f14720145ee927de1883f5f72d9e0
parent1dea2cc4b06fb8a29b40f9f74f23a659e15a51b3
misc: vmw_balloon: fix memory leak with using debugfs_lookup()

BugLink: https://bugs.launchpad.net/bugs/2011430
[ Upstream commit 209cdbd07cfaa4b7385bad4eeb47e5ec1887d33d ]

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 <namit@vmware.com>
Cc: VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230202141100.2291188-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/vmw_balloon.c