Skip to contentSkip to conversation

drm: fix an error code in drm_syncobj_transfer_to_timeline()

PATCH In review Dan Carpenter 2 participants 2 messages Jun 14, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: fix an error code in drm_syncobj_transfer_to_timeline()

Return -ENOMEM instead of success if dma_fence_unwrap_merge() fails.

Fixes ec8d985ff26f ("drm: use dma_fence_unwrap_merge() in drm_syncobj")
---
 drivers/gpu/drm/drm_syncobj.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_syncobj.c +3 -1
index bbad9e4696e7..0c2be8360525 100644
@@ -874,8 +874,10 @@ static int drm_syncobj_transfer_to_timeline(struct drm_file *file_private,
 
 	fence = dma_fence_unwrap_merge(tmp);
 	dma_fence_put(tmp);
-	if (!fence)
+	if (!fence) {
+		ret = -ENOMEM;
 		goto err_put_timeline;
+	}
 
 	chain = dma_fence_chain_alloc();
 	if (!chain) {
Signature · 1 line
2.35.1
#1 lore raw

Am 14.06.22 um 14:10 schrieb Dan Carpenter:

Quoted 1 line

Return -ENOMEM instead of success if dma_fence_unwrap_merge() fails.

You are to late Dan, that one was already reported and fixed https://lore.kernel.org/lkml/[email protected]/T/

Interesting that now the automated checkers are racing on finding and fixing those things :)

Christian.

Quoted 23 lines
Fixes ec8d985ff26f ("drm: use dma_fence_unwrap_merge() in drm_syncobj")
---
  drivers/gpu/drm/drm_syncobj.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_syncobj.c +3 -1
index bbad9e4696e7..0c2be8360525 100644
@@ -874,8 +874,10 @@ static int drm_syncobj_transfer_to_timeline(struct drm_file *file_private,
 
  	fence = dma_fence_unwrap_merge(tmp);
  	dma_fence_put(tmp);
-	if (!fence)
+	if (!fence) {
+		ret = -ENOMEM;
  		goto err_put_timeline;
+	}
 
  	chain = dma_fence_chain_alloc();
  	if (!chain) {