Commit 0a4c9ffb authored by Dan Carpenter's avatar Dan Carpenter Committed by Daniel Vetter

drm/hisilicon/hibmc: Checking for NULL instead of IS_ERR()

The drm_dev_alloc() function returns error pointers.  It never returns
NULLs.

Fixes: 5e0df3a0 ("drm/hisilicon/hibmc: Add hisilicon hibmc drm master driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161124113545.GP17225@mwanda
parent 04ea7dcb
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment