aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorArvind Yadav2017-01-30 17:39:49 +0100
committerBartlomiej Zolnierkiewicz2017-01-30 17:39:49 +0100
commit74a2b96e61d78051c70c24ad4499e0c8dcd1a0f1 (patch)
tree3c048b868e56745f354aaa96ab106e62498c3ad7 /drivers/video
parentf998ff681c0628c8da700a15975b4a57ec0ce707 (diff)
video: fbdev: stifb: handle NULL return value from ioremap_nocache
Add missing error check for ioremap_nocache() failure (prevents NULL pointer dereference on error). Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> [b.zolnierkie: minor fixes] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/stifb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c
index accfef71e984..6ded5c198998 100644
--- a/drivers/video/fbdev/stifb.c
+++ b/drivers/video/fbdev/stifb.c
@@ -1294,6 +1294,10 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
strcpy(fix->id, "stifb");
info->fbops = &stifb_ops;
info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len);
+ if (!info->screen_base) {
+ printk(KERN_ERR "stifb: failed to map memory\n");
+ goto out_err0;
+ }
info->screen_size = fix->smem_len;
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA;
info->pseudo_palette = &fb->pseudo_palette;