From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: airlied@linux.ie
Cc: airlied@redhat.com, daniel.vetter@ffwll.ch,
seanpaul@chromium.org, chris@chris-wilson.co.uk,
elfring@users.sourceforge.net, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [v1] gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap
Date: Tue, 3 Jan 2017 17:00:27 +0530 [thread overview]
Message-ID: <1483443027-13444-1-git-send-email-arvind.yadav.cs@gmail.com> (raw)
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
next reply other threads:[~2017-01-03 11:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-03 11:30 Arvind Yadav [this message]
2017-01-04 9:15 ` [v1] gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1483443027-13444-1-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=elfring@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=seanpaul@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).