Message ID | YqhG3ozn3cSazbrO@kili (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm: fix an error code in drm_syncobj_transfer_to_timeline() | expand |
Am 14.06.22 um 14:10 schrieb Dan Carpenter: > 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/4845ad23-476c-97b9-9b3f-d8aaa9027d26@amd.com/T/ Interesting that now the automated checkers are racing on finding and fixing those things :) Christian. > > Fixes: ec8d985ff26f ("drm: use dma_fence_unwrap_merge() in drm_syncobj") > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> > --- > drivers/gpu/drm/drm_syncobj.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c > index bbad9e4696e7..0c2be8360525 100644 > --- a/drivers/gpu/drm/drm_syncobj.c > +++ b/drivers/gpu/drm/drm_syncobj.c > @@ -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) {
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index bbad9e4696e7..0c2be8360525 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -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) {
Return -ENOMEM instead of success if dma_fence_unwrap_merge() fails. Fixes: ec8d985ff26f ("drm: use dma_fence_unwrap_merge() in drm_syncobj") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/gpu/drm/drm_syncobj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)