From: Daniel Vetter <daniel@ffwll.ch>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>,
Rongrong Zou <zourongrong@gmail.com>,
kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
Chen Feng <puck.chen@hisilicon.com>
Subject: Re: [patch] drm/hisilicon/hibmc: Checking for NULL instead of IS_ERR()
Date: Fri, 25 Nov 2016 06:43:48 +0000 [thread overview]
Message-ID: <20161125064348.iqvmc5d3dwtom4aj@phenom.ffwll.local> (raw)
In-Reply-To: <20161124113545.GP17225@mwanda>
On Thu, Nov 24, 2016 at 02:35:45PM +0300, Dan Carpenter wrote:
> The drm_dev_alloc() function returns error pointers. It never returns
> NULLs.
>
> Fixes: 5e0df3a08f3d ("drm/hisilicon/hibmc: Add hisilicon hibmc drm master driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to drm-misc, thanks.
-Daniel
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index 73ba8b0..d94e349 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -377,9 +377,9 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
> int ret;
>
> dev = drm_dev_alloc(&hibmc_driver, &pdev->dev);
> - if (!dev) {
> + if (IS_ERR(dev)) {
> DRM_ERROR("failed to allocate drm_device\n");
> - return -ENOMEM;
> + return PTR_ERR(dev);
> }
>
> dev->pdev = pdev;
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
prev parent reply other threads:[~2016-11-25 6:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-24 11:35 [patch] drm/hisilicon/hibmc: Checking for NULL instead of IS_ERR() Dan Carpenter
2016-11-25 6:43 ` Daniel Vetter [this message]
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=20161125064348.iqvmc5d3dwtom4aj@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=puck.chen@hisilicon.com \
--cc=z.liuxinliang@hisilicon.com \
--cc=zourongrong@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox