Skip to contentSkip to conversation

drm/core: Fix error condition in __setplane_internal.

PATCH In review Maarten Lankhorst 2 participants 2 messages Oct 19, 2015

Subsystems (2)
lore
Share & tools
lore

Maarten Lankhorst

author maintainer
#0 lore raw

PATCH 1/1 drm/core: Fix error condition in __setplane_internal.

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 <[email protected]>
Fixes 3968be946a057baa

---

drivers/gpu/drm/drm_crtc.c +2 -1
index 7ec0247cf8db..7db9b3ed5415 100644
@@ -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
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw
Quoted 8 lines · Maarten Lankhorst

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 <[email protected]>
Fixes 3968be946a057baa

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

Quoted 16 lines

---

drivers/gpu/drm/drm_crtc.c +2 -1
index 7ec0247cf8db..7db9b3ed5415 100644
@@ -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;
 	}
 
 
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx