public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/core: Fix error condition in __setplane_internal.
@ 2015-10-19 13:14 Maarten Lankhorst
  2015-10-19 13:32 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Maarten Lankhorst @ 2015-10-19 13:14 UTC (permalink / raw)
  To: dri-devel@lists.freedesktop.org; +Cc: Intel Graphics Development

Just like the other checks the crtc coordinates need to use goto out.

This fixes a framebuffer leak introduced by commit 3968be946a057baa.
"drm: Make integer overflow checking cover universal cursor updates (v2)"

Cc: Matt Roper <matthew.d.roper@intel.com>
Fixes: 3968be946a057baa
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 7ec0247cf8db..7db9b3ed5415 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2342,7 +2342,8 @@ static int __setplane_internal(struct drm_plane *plane,
 	    crtc_y > INT_MAX - (int32_t) crtc_h) {
 		DRM_DEBUG_KMS("Invalid CRTC coordinates %ux%u+%d+%d\n",
 			      crtc_w, crtc_h, crtc_x, crtc_y);
-		return -ERANGE;
+		ret = -ERANGE;
+		goto out;
 	}
 
 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/core: Fix error condition in __setplane_internal.
  2015-10-19 13:14 [PATCH] drm/core: Fix error condition in __setplane_internal Maarten Lankhorst
@ 2015-10-19 13:32 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2015-10-19 13:32 UTC (permalink / raw)
  To: Maarten Lankhorst
  Cc: Intel Graphics Development, dri-devel@lists.freedesktop.org

On Mon, Oct 19, 2015 at 03:14:52PM +0200, Maarten Lankhorst wrote:
> Just like the other checks the crtc coordinates need to use goto out.
> 
> This fixes a framebuffer leak introduced by commit 3968be946a057baa.
> "drm: Make integer overflow checking cover universal cursor updates (v2)"
> 
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Fixes: 3968be946a057baa
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

I already merged a patch from Ville to fix this. At least git didn't
manage to apply yours on top ;-)
-Daniel

> ---
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 7ec0247cf8db..7db9b3ed5415 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -2342,7 +2342,8 @@ static int __setplane_internal(struct drm_plane *plane,
>  	    crtc_y > INT_MAX - (int32_t) crtc_h) {
>  		DRM_DEBUG_KMS("Invalid CRTC coordinates %ux%u+%d+%d\n",
>  			      crtc_w, crtc_h, crtc_x, crtc_y);
> -		return -ERANGE;
> +		ret = -ERANGE;
> +		goto out;
>  	}
>  
>  
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-19 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-19 13:14 [PATCH] drm/core: Fix error condition in __setplane_internal Maarten Lankhorst
2015-10-19 13:32 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox