Skip to contentSkip to conversation

drm/nouveau: fix bad ret code in nouveau_bo_move_prep

PATCH Applied Shuhao Fu 3 participants 3 messages Oct 7, 2025

Subsystems (3)
lore
Share & tools
lore

Shuhao Fu

author
#0 lore raw

PATCH 1/1 drm/nouveau: fix bad ret code in nouveau_bo_move_prep

In nouveau_bo_move_prep, if nouveau_mem_map fails, an error code should be returned. Currently, it returns zero even if vmm addr is not correctly mapped.

Fixes 9ce523cc3bf2 ("drm/nouveau: separate buffer object backing memory from nvkm structures")
---
 drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +1 -1
index b96f0555ca14..f26562eafffc 100644
@@ -929,7 +929,7 @@ nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo,
 		nvif_vmm_put(vmm, &old_mem->vma[1]);
 		nvif_vmm_put(vmm, &old_mem->vma[0]);
 	}
-	return 0;
+	return ret;
 }
 
 static int
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw

Hi,

[ Cc Ben ]

Quoted 15 lines

In nouveau_bo_move_prep, if nouveau_mem_map fails, an error code should be returned. Currently, it returns zero even if vmm addr is not correctly mapped.

Fixes 9ce523cc3bf2 ("drm/nouveau: separate buffer object backing memory from nvkm structures")
---
 drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -0
index b96f0555ca14..f26562eafffc 100644

drivers/gpu/drm/nouveau/nouveau_bo.c nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo, · line 932

Quoted 5 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +1 -1
@@ -929,7 +929,7 @@ nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo,
 		nvif_vmm_put(vmm, &old_mem->vma[1]);
 		nvif_vmm_put(vmm, &old_mem->vma[0]);
 	}
-	return 0;
+	return ret;

LGTM.

Kind regards,
Petr

maintainer Applied
#2 lore raw
In reply to Shuhao Fu
Quoted 6 lines · Shuhao Fu

In nouveau_bo_move_prep, if nouveau_mem_map fails, an error code should be returned. Currently, it returns zero even if vmm addr is not correctly mapped.

Fixes 9ce523cc3bf2 ("drm/nouveau: separate buffer object backing memory from nvkm structures")

Applied to drm-misc-fixes, thanks!