linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v1] gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap
@ 2017-01-03 11:30 Arvind Yadav
  2017-01-04  9:15 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-01-03 11:30 UTC (permalink / raw)
  To: airlied
  Cc: airlied, daniel.vetter, seanpaul, chris, elfring, dri-devel,
	linux-kernel

Here, pci_iomap can fail, handle this case and return -ENOMEM.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/gpu/drm/mgag200/mgag200_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c
index e79cbc2..fb03e30 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);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-04  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 11:30 [v1] gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap Arvind Yadav
2017-01-04  9:15 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).