diff mbox series

drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user

Message ID 20190131100721.3573-1-thellstrom@vmware.com (mailing list archive)
State New, archived
Headers show
Series drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user | expand

Commit Message

Thomas Hellstrom Jan. 31, 2019, 10:07 a.m. UTC
The function was unconditionally returning 0, and a caller would have to
rely on the returned fence pointer being NULL to detect errors. However,
the function vmw_execbuf_copy_fence_user() would expect a non-zero error
code in that case and would BUG otherwise.

So make sure we return a proper non-zero error code if the fence pointer
returned is NULL.

Fixes: ae2a104058e2: ("vmwgfx: Implement fence objects")
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Deepak Singh Rawat Feb. 1, 2019, 2:03 a.m. UTC | #1
Reviewed-by: Deepak Rawat <drawat@vmware.com>

On Thu, 2019-01-31 at 11:07 +0100, Thomas Hellstrom wrote:
> The function was unconditionally returning 0, and a caller would have
> to
> rely on the returned fence pointer being NULL to detect errors.
> However,
> the function vmw_execbuf_copy_fence_user() would expect a non-zero
> error
> code in that case and would BUG otherwise.
> 
> So make sure we return a proper non-zero error code if the fence
> pointer
> returned is NULL.
> 
> Fixes: ae2a104058e2: ("vmwgfx: Implement fence objects")
> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> index f2d13a72c05d..88b8178d4687 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> @@ -3570,7 +3570,7 @@ int vmw_execbuf_fence_commands(struct drm_file
> *file_priv,
>  		*p_fence = NULL;
>  	}
>  
> -	return 0;
> +	return ret;
>  }
>  
>  /**
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
index f2d13a72c05d..88b8178d4687 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
@@ -3570,7 +3570,7 @@  int vmw_execbuf_fence_commands(struct drm_file *file_priv,
 		*p_fence = NULL;
 	}
 
-	return 0;
+	return ret;
 }
 
 /**