Skip to contentSkip to conversation

drm: Fix framebuffer leak

PATCH In review Nikhil Mahale 2 participants 2 messages Aug 9, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Fix framebuffer leak

Do not leak framebuffer if client provided crtc id found invalid.

---
 drivers/gpu/drm/drm_plane.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_plane.c +1 -0
index 5dc8c43..e40c12f 100644
@@ -601,6 +601,7 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
 
 		crtc = drm_crtc_find(dev, plane_req->crtc_id);
 		if (!crtc) {
+			drm_framebuffer_put(fb);
 			DRM_DEBUG_KMS("Unknown crtc ID %d\n",
 				      plane_req->crtc_id);
 			return -ENOENT;
Signature · 6 lines
2.6.6

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 3 lines · Nikhil Mahale

Do not leak framebuffer if client provided crtc id found invalid.

Nice catch, applied for 4.13-rc and cc: stable.
-Daniel

Quoted 23 lines
---
 drivers/gpu/drm/drm_plane.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_plane.c +1 -0
index 5dc8c43..e40c12f 100644
@@ -601,6 +601,7 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
 
 		crtc = drm_crtc_find(dev, plane_req->crtc_id);
 		if (!crtc) {
+			drm_framebuffer_put(fb);
 			DRM_DEBUG_KMS("Unknown crtc ID %d\n",
 				      plane_req->crtc_id);
 			return -ENOENT;
Signature · 6 lines
2.6.6

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel