From: Arvind Yadav Date: Tue, 3 Jan 2017 11:30:27 +0000 (+0530) Subject: gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4b0ea93f250afc6c1128e201b0a8a115ae613e47;p=linux-beck.git 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 Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1483443027-13444-1-git-send-email-arvind.yadav.cs@gmail.com --- 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);