All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Shawn Guo <shawnguo@kernel.org>
Cc: David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: [patch] drm: zte: checking for NULL instead of IS_ERR()
Date: Tue, 15 Nov 2016 09:53:01 +0000	[thread overview]
Message-ID: <20161115095301.GC15424@mwanda> (raw)

drm_dev_alloc() never returns NULL, it only returns error pointers on
error.

Fixes: 0a886f59528a ("drm: zte: add initial vou drm driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
index abc8099..3e76f72 100644
--- a/drivers/gpu/drm/zte/zx_drm_drv.c
+++ b/drivers/gpu/drm/zte/zx_drm_drv.c
@@ -107,8 +107,8 @@ static int zx_drm_bind(struct device *dev)
 		return -ENOMEM;
 
 	drm = drm_dev_alloc(&zx_drm_driver, dev);
-	if (!drm)
-		return -ENOMEM;
+	if (IS_ERR(drm))
+		return PTR_ERR(drm);
 
 	drm->dev_private = priv;
 	dev_set_drvdata(dev, drm);

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Shawn Guo <shawnguo@kernel.org>
Cc: David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: [patch] drm: zte: checking for NULL instead of IS_ERR()
Date: Tue, 15 Nov 2016 12:53:01 +0300	[thread overview]
Message-ID: <20161115095301.GC15424@mwanda> (raw)

drm_dev_alloc() never returns NULL, it only returns error pointers on
error.

Fixes: 0a886f59528a ("drm: zte: add initial vou drm driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
index abc8099..3e76f72 100644
--- a/drivers/gpu/drm/zte/zx_drm_drv.c
+++ b/drivers/gpu/drm/zte/zx_drm_drv.c
@@ -107,8 +107,8 @@ static int zx_drm_bind(struct device *dev)
 		return -ENOMEM;
 
 	drm = drm_dev_alloc(&zx_drm_driver, dev);
-	if (!drm)
-		return -ENOMEM;
+	if (IS_ERR(drm))
+		return PTR_ERR(drm);
 
 	drm->dev_private = priv;
 	dev_set_drvdata(dev, drm);

             reply	other threads:[~2016-11-15  9:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15  9:53 Dan Carpenter [this message]
2016-11-15  9:53 ` [patch] drm: zte: checking for NULL instead of IS_ERR() Dan Carpenter
2016-11-15 10:00 ` Daniel Vetter
2016-11-15 10:00   ` 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=20161115095301.GC15424@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=shawnguo@kernel.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 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.