diff mbox

[1/7] drm/udl: fix error-path when damage-req fails

Message ID 1390245989-13280-1-git-send-email-dh.herrmann@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Herrmann Jan. 20, 2014, 7:26 p.m. UTC
We need to call dma_buf_end_cpu_access() in case a damage-request.
Unlikely, but might happen during device unplug.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
 drivers/gpu/drm/udl/udl_fb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Daniel Vetter Jan. 21, 2014, 9:43 a.m. UTC | #1
On Mon, Jan 20, 2014 at 08:26:23PM +0100, David Herrmann wrote:
> We need to call dma_buf_end_cpu_access() in case a damage-request.
> Unlikely, but might happen during device unplug.
> 
> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
> ---
>  drivers/gpu/drm/udl/udl_fb.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
> index dbadd49..50f564d 100644
> --- a/drivers/gpu/drm/udl/udl_fb.c
> +++ b/drivers/gpu/drm/udl/udl_fb.c
> @@ -421,9 +421,10 @@ static int udl_user_framebuffer_dirty(struct drm_framebuffer *fb,
>  				  clips[i].x2 - clips[i].x1,
>  				  clips[i].y2 - clips[i].y1);
>  		if (ret)
> -			goto unlock;
> +			goto end_access;

break instead of a goto?

>  	}
>  
> +end_access:
>  	if (ufb->obj->base.import_attach) {
>  		dma_buf_end_cpu_access(ufb->obj->base.import_attach->dmabuf,
>  				       0, ufb->obj->base.size,
> -- 
> 1.8.5.3
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
index dbadd49..50f564d 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
@@ -421,9 +421,10 @@  static int udl_user_framebuffer_dirty(struct drm_framebuffer *fb,
 				  clips[i].x2 - clips[i].x1,
 				  clips[i].y2 - clips[i].y1);
 		if (ret)
-			goto unlock;
+			goto end_access;
 	}
 
+end_access:
 	if (ufb->obj->base.import_attach) {
 		dma_buf_end_cpu_access(ufb->obj->base.import_attach->dmabuf,
 				       0, ufb->obj->base.size,