diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-11-24 14:35:45 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-11-25 07:58:49 +0100 |
commit | 0a4c9ffbd47669d1a0534dbbd45c2855531a6e7d (patch) | |
tree | 3a7815ffb11eef511adcf604c32dd32407b5bd00 /drivers/gpu | |
parent | 04ea7dcba47325d8d2256aaf0cbd21818f280d87 (diff) | |
download | op-kernel-dev-0a4c9ffbd47669d1a0534dbbd45c2855531a6e7d.zip op-kernel-dev-0a4c9ffbd47669d1a0534dbbd45c2855531a6e7d.tar.gz |
drm/hisilicon/hibmc: Checking for NULL instead of IS_ERR()
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>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161124113545.GP17225@mwanda
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |