diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-01-30 17:39:49 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2017-01-30 17:39:49 +0100 |
commit | 74a2b96e61d78051c70c24ad4499e0c8dcd1a0f1 (patch) | |
tree | 3c048b868e56745f354aaa96ab106e62498c3ad7 /drivers | |
parent | video: fbdev: pmagb-b-fb: Remove bad `__init' annotation (diff) | |
download | linux-74a2b96e61d78051c70c24ad4499e0c8dcd1a0f1.tar.xz linux-74a2b96e61d78051c70c24ad4499e0c8dcd1a0f1.zip |
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')
-rw-r--r-- | drivers/video/fbdev/stifb.c | 4 |
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; |