From: Dan Carpenter <dan.carpenter@oracle.com>
To: Marek Vasut <marex@denx.de>
Cc: David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: [patch] drm: mxsfb: drm_dev_alloc() returns error pointers
Date: Tue, 13 Dec 2016 12:23:32 +0000 [thread overview]
Message-ID: <20161213122332.GA7519@elgon.mountain> (raw)
We should be checking for IS_ERR() instead of NULL because
drm_dev_alloc() returns error pointers.
Fixes: 45d59d704080 ("drm: Add new driver for MXSFB controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 79a18bf48b54..955441f71500 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -395,8 +395,8 @@ static int mxsfb_probe(struct platform_device *pdev)
pdev->id_entry = of_id->data;
drm = drm_dev_alloc(&mxsfb_driver, &pdev->dev);
- if (!drm)
- return -ENOMEM;
+ if (IS_ERR(drm))
+ return PTR_ERR(drm);
ret = mxsfb_load(drm, 0);
if (ret)
next reply other threads:[~2016-12-13 12:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-13 12:23 Dan Carpenter [this message]
2016-12-13 12:36 ` [patch] drm: mxsfb: drm_dev_alloc() returns error pointers Marek Vasut
2016-12-13 21:25 ` 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=20161213122332.GA7519@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=marex@denx.de \
/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