]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/hyperv: Fix address space leak when Hyper-V DRM device is removed
authorMichael Kelley <mhklinux@outlook.com>
Mon, 10 Feb 2025 19:34:41 +0000 (11:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:11 +0000 (12:54 -0700)
commit24f1bbfb2be77dad82489c1468bbb14312aab129
tree47091d4cf37984077450050240858d11ef7f7660
parentbe7188d7f1f6f3ca38134cf618e5f114dca8d23a
drm/hyperv: Fix address space leak when Hyper-V DRM device is removed

[ Upstream commit aed709355fd05ef747e1af24a1d5d78cd7feb81e ]

When a Hyper-V DRM device is probed, the driver allocates MMIO space for
the vram, and maps it cacheable. If the device removed, or in the error
path for device probing, the MMIO space is released but no unmap is done.
Consequently the kernel address space for the mapping is leaked.

Fix this by adding iounmap() calls in the device removal path, and in the
error path during device probing.

Fixes: f1f63cbb705d ("drm/hyperv: Fix an error handling path in hyperv_vmbus_probe()")
Fixes: a0ab5abced55 ("drm/hyperv : Removing the restruction of VRAM allocation with PCI bar size")
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Tested-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Link: https://lore.kernel.org/r/20250210193441.2414-1-mhklinux@outlook.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20250210193441.2414-1-mhklinux@outlook.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/hyperv/hyperv_drm_drv.c