drm/nouveau/dmem: Fix a NULL vs IS_ERR() check

The hmm_devmem_add() function doesn't return NULL, it returns error
pointers.

Fixes: 5be73b6908 ("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>
This commit is contained in:
Dan Carpenter 2019-02-22 09:34:04 +03:00 committed by Ben Skeggs
parent 2219c9ee92
commit 18ec3c129b
1 changed files with 1 additions and 1 deletions

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