gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Tue, 3 Jan 2017 11:30:27 +0000 (17:00 +0530)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 4 Jan 2017 09:15:37 +0000 (10:15 +0100)
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
drivers/gpu/drm/mgag200/mgag200_main.c

index 95d628b9457e56af865bf99ce0d1b137417915bc..da8ba6c154e33b141e4b52f00d2911c52c5ccbf8 100644 (file)
@@ -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);