From: Dan Carpenter Date: Thu, 24 Nov 2016 11:35:45 +0000 (+0300) Subject: drm/hisilicon/hibmc: Checking for NULL instead of IS_ERR() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a4c9ffbd47669d1a0534dbbd45c2855531a6e7d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20161124113545.GP17225@mwanda --- diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 73ba8b05f1da..d94e3495c9b2 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;