Skip to content

Commit

Permalink
drm/nouveau/dmem: Fix a NULL vs IS_ERR() check
Browse files Browse the repository at this point in the history
The hmm_devmem_add() function doesn't return NULL, it returns error
pointers.

Fixes: 5be73b6 ("drm/nouveau/dmem: device memory helpers for SVM")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
  • Loading branch information
Dan Carpenter authored and Ben Skeggs committed Mar 21, 2019
1 parent 2219c9e commit 18ec3c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_dmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 18ec3c1

Please sign in to comment.