From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Airlie <airlied@linux.ie>
Cc: Thierry Reding <treding@nvidia.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
Benoit Taine <benoit.taine@lip6.fr>,
Dave Airlie <airlied@redhat.com>
Subject: [patch] drm/gma500: missing error codes in psb_driver_load()
Date: Fri, 17 Apr 2015 12:24:08 +0000 [thread overview]
Message-ID: <20150417122408.GA19623@mwanda> (raw)
We should return an error code here. In the current code they can only
fail if there is an allocation error so -ENOMEM is appropriate.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 92e7e57..4eff0d6 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -326,12 +326,16 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
goto out_err;
dev_priv->mmu = psb_mmu_driver_init(dev, 1, 0, 0);
- if (!dev_priv->mmu)
+ if (!dev_priv->mmu) {
+ ret = -ENOMEM;
goto out_err;
+ }
dev_priv->pf_pd = psb_mmu_alloc_pd(dev_priv->mmu, 1, 0);
- if (!dev_priv->pf_pd)
+ if (!dev_priv->pf_pd) {
+ ret = -ENOMEM;
goto out_err;
+ }
ret = psb_do_init(dev);
if (ret)
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Airlie <airlied@linux.ie>
Cc: Thierry Reding <treding@nvidia.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
Benoit Taine <benoit.taine@lip6.fr>,
Dave Airlie <airlied@redhat.com>
Subject: [patch] drm/gma500: missing error codes in psb_driver_load()
Date: Fri, 17 Apr 2015 15:24:08 +0300 [thread overview]
Message-ID: <20150417122408.GA19623@mwanda> (raw)
We should return an error code here. In the current code they can only
fail if there is an allocation error so -ENOMEM is appropriate.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 92e7e57..4eff0d6 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -326,12 +326,16 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
goto out_err;
dev_priv->mmu = psb_mmu_driver_init(dev, 1, 0, 0);
- if (!dev_priv->mmu)
+ if (!dev_priv->mmu) {
+ ret = -ENOMEM;
goto out_err;
+ }
dev_priv->pf_pd = psb_mmu_alloc_pd(dev_priv->mmu, 1, 0);
- if (!dev_priv->pf_pd)
+ if (!dev_priv->pf_pd) {
+ ret = -ENOMEM;
goto out_err;
+ }
ret = psb_do_init(dev);
if (ret)
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2015-04-17 12:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 12:24 Dan Carpenter [this message]
2015-04-17 12:24 ` [patch] drm/gma500: missing error codes in psb_driver_load() Dan Carpenter
2015-04-17 12:56 ` Patrik Jakobsson
2015-04-17 12:56 ` Patrik Jakobsson
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=20150417122408.GA19623@mwanda \
--to=dan.carpenter@oracle.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=benoit.taine@lip6.fr \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=treding@nvidia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.