summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mgag200
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-01-03 17:00:27 +0530
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-01-04 10:15:37 +0100
commit4b0ea93f250afc6c1128e201b0a8a115ae613e47 (patch)
tree77350e0918c8be406042c5cd6641776afff4d23b /drivers/gpu/drm/mgag200
parent569265002782503d40fb32a45a950f2ac42af353 (diff)
gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap
Here, pci_iomap can fail, handle this case and return -ENOMEM. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1483443027-13444-1-git-send-email-arvind.yadav.cs@gmail.com
Diffstat (limited to 'drivers/gpu/drm/mgag200')
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c
index 95d628b9457e..da8ba6c154e3 100644
--- a/drivers/gpu/drm/mgag200/mgag200_main.c
+++ b/drivers/gpu/drm/mgag200/mgag200_main.c
@@ -145,6 +145,8 @@ static int mga_vram_init(struct mga_device *mdev)
}
mem = pci_iomap(mdev->dev->pdev, 0, 0);
+ if (!mem)
+ return -ENOMEM;
mdev->mc.vram_size = mga_probe_vram(mdev, mem);