Commit 9d998909 authored by Dejin Zheng's avatar Dejin Zheng Committed by Kelsey Skunberg

video: fbdev: sm712fb: fix an issue about iounmap for a wrong address

BugLink: https://bugs.launchpad.net/bugs/1892822

[ Upstream commit 98bd4f72 ]

the sfb->fb->screen_base is not save the value get by iounmap() when
the chip id is 0x720. so iounmap() for address sfb->fb->screen_base
is not right.

Fixes: 1461d667 ("staging: sm7xxfb: merge sm712fb with fbdev")
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarDejin Zheng <zhengdejin5@gmail.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200422160719.27763-1-zhengdejin5@gmail.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent c6ff489c
...@@ -1428,6 +1428,8 @@ static int smtc_map_smem(struct smtcfb_info *sfb, ...@@ -1428,6 +1428,8 @@ static int smtc_map_smem(struct smtcfb_info *sfb,
static void smtc_unmap_smem(struct smtcfb_info *sfb) static void smtc_unmap_smem(struct smtcfb_info *sfb)
{ {
if (sfb && sfb->fb->screen_base) { if (sfb && sfb->fb->screen_base) {
if (sfb->chip_id == 0x720)
sfb->fb->screen_base -= 0x00200000;
iounmap(sfb->fb->screen_base); iounmap(sfb->fb->screen_base);
sfb->fb->screen_base = NULL; sfb->fb->screen_base = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment