[PATCH 5/6] drm/i915: Set crtc->name to "pipe A", "pipe B", etc.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_display.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b628dab..2b5e81a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10711,6 +10711,7 @@ static void intel_crtc_destroy(struct drm_crtc *crtc)
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct drm_device *dev = crtc->dev;
 	struct intel_unpin_work *work;
+	char *name;
 
 	spin_lock_irq(&dev->event_lock);
 	work = intel_crtc->unpin_work;
@@ -10722,8 +10723,13 @@ static void intel_crtc_destroy(struct drm_crtc *crtc)
 		kfree(work);
 	}
 
+	/*
+	 * drm_crtc_cleanup() zeroes the structure, so
+	 * need an extra dance to avoid leaking the name.
+	 */
+	name = crtc->name;
 	drm_crtc_cleanup(crtc);
-
+	kfree(name);
 	kfree(intel_crtc);
 }
 
@@ -14036,6 +14042,11 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
 	if (intel_crtc == NULL)
 		return;
 
+	intel_crtc->base.name = kasprintf(GFP_KERNEL, "pipe %c",
+					  pipe_name(pipe));
+	if (!intel_crtc->base.name)
+		return;
+
 	crtc_state = kzalloc(sizeof(*crtc_state), GFP_KERNEL);
 	if (!crtc_state)
 		goto fail;
@@ -14106,6 +14117,7 @@ fail:
 	if (cursor)
 		drm_plane_cleanup(cursor);
 	kfree(crtc_state);
+	kfree(intel_crtc->base.name);
 	kfree(intel_crtc);
 }
 
-- 
2.4.10

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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux