]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/nouveau/dmem: Fix a NULL vs IS_ERR() check
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 22 Feb 2019 06:34:04 +0000 (09:34 +0300)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 21 Mar 2019 23:57:58 +0000 (09:57 +1000)
The hmm_devmem_add() function doesn't return NULL, it returns error
pointers.

Fixes: a834b0dc352f ("drm/nouveau/dmem: device memory helpers for SVM")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_dmem.c

index 58b4cb389d87a11250cb8882d0d39521c4c978c7..b1df42f73ec26088c17e576a7fa5fac48cd84a60 100644 (file)
@@ -621,7 +621,7 @@ nouveau_dmem_init(struct nouveau_drm *drm)
         */
        drm->dmem->devmem = hmm_devmem_add(&nouveau_dmem_devmem_ops,
                                           device, size);
-       if (drm->dmem->devmem == NULL) {
+       if (IS_ERR(drm->dmem->devmem)) {
                kfree(drm->dmem);
                drm->dmem = NULL;
                return;