提交 0a4c9ffb 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161124113545.GP17225@mwanda
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册