@@ -10723,7 +10723,6 @@ static void intel_crtc_destroy(struct drm_crtc *crtc)
}
drm_crtc_cleanup(crtc);
-
kfree(intel_crtc);
}
@@ -14026,15 +14025,16 @@ static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_cr
static void intel_crtc_init(struct drm_device *dev, int pipe)
{
struct drm_i915_private *dev_priv = dev->dev_private;
- struct intel_crtc *intel_crtc;
+ struct intel_crtc *intel_crtc = NULL;
struct intel_crtc_state *crtc_state = NULL;
struct drm_plane *primary = NULL;
struct drm_plane *cursor = NULL;
+ char name[16];
int i, ret;
intel_crtc = kzalloc(sizeof(*intel_crtc), GFP_KERNEL);
- if (intel_crtc == NULL)
- return;
+ if (!intel_crtc)
+ goto fail;
crtc_state = kzalloc(sizeof(*crtc_state), GFP_KERNEL);
if (!crtc_state)
@@ -14043,6 +14043,9 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
intel_crtc->base.state = &crtc_state->base;
crtc_state->base.crtc = &intel_crtc->base;
+ ret = snprintf(name, sizeof(name), "pipe %c", pipe_name(pipe));
+ WARN_ON(ret >= sizeof(name));
+
/* initialize shared scalers */
if (INTEL_INFO(dev)->gen >= 9) {
if (pipe == PIPE_C)
@@ -14062,7 +14065,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
goto fail;
ret = drm_crtc_init_with_planes(dev, &intel_crtc->base, primary,
- cursor, &intel_crtc_funcs, "");
+ cursor, &intel_crtc_funcs, name);
if (ret)
goto fail;