From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 278752580E1; Tue, 25 Mar 2025 12:26:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742905569; cv=none; b=dHwhJGB78IA4EqPlBoMpA47I/UBDB905lN2M/zl0fvkEjczgWq0U+vtAzniEKNOQk3reDdxzEngKyk3LM8szF2ZnzFfPhRpVnCE+KeR+Vth4ph4ureGyCEe8Y6+meaOAuigv03jZ9jN/CoqWRef9pmG6Pnw2WK35JtKQvWRqRck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742905569; c=relaxed/simple; bh=JDzj/A63IK0uqx0qbLPhMhGV3etm4l4QF6n4RyiFnhI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hNTCMAQi7VHuitFOmngIV4sWhKC4gOfdaHTDuk612TJXuWUq5yhnMLjVMJGgMWmB4BNQZD6g9DEwxdQ8S6aVsm9zZCM3E9SvN79J1asmywkkwNXBKAwtTvxxgZKDfB7YSLkpsxE554AzRvdV5zei8MWOLuYM5/GCHZH5PyP12ug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=o7zWNMV2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="o7zWNMV2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEB7DC4CEE4; Tue, 25 Mar 2025 12:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1742905569; bh=JDzj/A63IK0uqx0qbLPhMhGV3etm4l4QF6n4RyiFnhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o7zWNMV2nuYMz2GCdQPiPW2VS9hF9PsZcYn38blYs2Jpx3XxCLsaS5Brmkmy97XeD /vYV3Q5nf5RxnsLpoUNOyZQ/iW/MhJiIVc54GXseXq6DJuCQMn8ZeZx6YU/0lmWw9X hxVAj5A5JOTlBo+q2L9tvTPOZ4dBEu0/nT5hxcUo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michael Kelley , Saurabh Sengar , Wei Liu , Sasha Levin Subject: [PATCH 6.1 005/198] fbdev: hyperv_fb: iounmap() the correct memory when removing a device Date: Tue, 25 Mar 2025 08:19:27 -0400 Message-ID: <20250325122156.780619979@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250325122156.633329074@linuxfoundation.org> References: <20250325122156.633329074@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Kelley [ Upstream commit 7241c886a71797cc51efc6fadec7076fcf6435c2 ] 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 Reviewed-by: Saurabh Sengar Link: https://lore.kernel.org/r/20250209235252.2987-1-mhklinux@outlook.com Signed-off-by: Wei Liu Message-ID: <20250209235252.2987-1-mhklinux@outlook.com> Signed-off-by: Sasha Levin --- 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 d3d643cf7506c..41c496ff55cc4 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -1106,7 +1106,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.39.5