Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH 1/1] fbdev: hyperv_fb: iounmap() the correct memory when removing a device
@ 2025-02-09 23:52 mhkelley58
  2025-02-10 12:40 ` Saurabh Singh Sengar
  2025-02-12  2:27 ` Wei Liu
  0 siblings, 2 replies; 10+ messages in thread
From: mhkelley58 @ 2025-02-09 23:52 UTC (permalink / raw)
  To: haiyangz, wei.liu, decui, deller, weh
  Cc: dri-devel, linux-fbdev, linux-kernel, linux-hyperv

From: Michael Kelley <mhklinux@outlook.com>

When a Hyper-V framebuffer device is removed, or the driver is unbound
from a device, any allocated and/or mapped memory must be released. In
particular, MMIO address space that was mapped to the framebuffer must
be unmapped. Current code unmaps the wrong address, resulting in an
error like:

[ 4093.980597] iounmap: bad address 00000000c936c05c

followed by a stack dump.

Commit d21987d709e8 ("video: hyperv: hyperv_fb: Support deferred IO for
Hyper-V frame buffer driver") changed the kind of address stored in
info->screen_base, and the iounmap() call in hvfb_putmem() was not
updated accordingly.

Fix this by updating hvfb_putmem() to unmap the correct address.

Fixes: d21987d709e8 ("video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver")
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
---
 drivers/video/fbdev/hyperv_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
index 7fdb5edd7e2e..363e4ccfcdb7 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
@@ -1080,7 +1080,7 @@ static void hvfb_putmem(struct hv_device *hdev, struct fb_info *info)
 
 	if (par->need_docopy) {
 		vfree(par->dio_vp);
-		iounmap(info->screen_base);
+		iounmap(par->mmio_vp);
 		vmbus_free_mmio(par->mem->start, screen_fb_size);
 	} else {
 		hvfb_release_phymem(hdev, info->fix.smem_start,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-02-13  3:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-09 23:52 [PATCH 1/1] fbdev: hyperv_fb: iounmap() the correct memory when removing a device mhkelley58
2025-02-10 12:40 ` Saurabh Singh Sengar
2025-02-10 14:28   ` Michael Kelley
2025-02-10 14:58     ` Saurabh Singh Sengar
2025-02-10 16:52       ` Saurabh Singh Sengar
2025-02-11  3:51         ` Michael Kelley
2025-02-13  1:35         ` Michael Kelley
2025-02-13  3:06           ` Saurabh Singh Sengar
2025-02-13  3:43             ` Michael Kelley
2025-02-12  2:27 ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox