File 0307-drm-hisilicon-hibmc-Checking-for-NULL-instead-of-IS_.patch of Package drm.openSUSE_Leap_42.3_Update

From f7c2e26666730a1cd18f74f1ff81078708e85901 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 24 Nov 2016 14:35:45 +0300
Subject: [PATCH 7/8] drm/hisilicon/hibmc: Checking for NULL instead of
 IS_ERR()
Git-commit: 0a4c9ffbd47669d1a0534dbbd45c2855531a6e7d
Patch-mainline: v4.10-rc1
References: fate#322061

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
Signed-off-by: Patrik Jakobsson <pjakobsson@suse.de>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 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_de
 	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;