From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82C553DBD7F for ; Thu, 9 Apr 2026 17:09:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775754542; cv=none; b=OzRTxF//xMjoxPbyr3VYF8NRzHCuSw3QaNElluVhzJ0a89ZESvI6+mjAgY2i3mFx1ay/dBE24S1NQ8uiuSeje3fCqJCLoD2SvHOQd6QxLjTHVOhTTciMLE41XTJULf7kNJ6B0FrW+B2IspLTkiddIesFMar/eFA/iRmfddJjjdM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775754542; c=relaxed/simple; bh=yLrayC+KaA1mutcx1StNH+IzSKSUoGWnncSyqPc87XA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UF2s/Lznwx1LpxRb7ARA3rZV4UQSGvKojjQwZz8xyaVO0oz1b5PMFk+sTR0TSsdHly5Wj6YjYnV2xgufzAKqQyQYIZAespnplL/Jn5iQc8GujmDit9tRgdS6kQSa7Nm/9ymhLjFgQm/U6zAravowydXjFwkF/nHriO/75L1SxDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Esilw5jB; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Esilw5jB" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 182F8C5C18C; Thu, 9 Apr 2026 17:09:34 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4E569603E4; Thu, 9 Apr 2026 17:08:59 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 63A85104500F2; Thu, 9 Apr 2026 19:08:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775754537; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=NhYzqxeLYhJJ/6ErxgYsDp7OCqAbT6h4r7mS/NeBN9E=; b=Esilw5jBNt2HrURjOGXsg52LiDQiFuR0QII4Q91Rpe6T0eEUWE3VvQMHZ+yKKX+MzIInVx 3roiCnEIl7sK/Fr89SK+iIVzA3aSLyUJpoSanEFRF/PUhnZide9jpzZBl2ql4TVzB0w5Jy LketgkWtt6ykso5AUT4CbjuyQcVFnYbFo6hZAYsEQJK6mcsV5/fOfmMibllUS1SJL0eIOr 8dQxWlx4hITtWuQWnURGImJNSoHUjGMi0ZvaiW2tux7699tL+xK3EcK4Xd/2EUQWkThmuU OwDnYjTfVFwSjKHvtXFGcZGePvXwyZy/qN6G69EvEzyBFbOtXBTcNd80Pmw9CQ== From: Kory Maincent Date: Thu, 09 Apr 2026 19:08:18 +0200 Subject: [PATCH RFC 02/12] drm/i915/display/intel_lvds: Drop redundant manual cleanup on init failure Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260409-feat_link_cap-v1-2-7069e8199ce2@bootlin.com> References: <20260409-feat_link_cap-v1-0-7069e8199ce2@bootlin.com> In-Reply-To: <20260409-feat_link_cap-v1-0-7069e8199ce2@bootlin.com> To: Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , David Airlie , Simona Vetter , Dave Airlie , Jesse Barnes , Eric Anholt , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Chris Wilson Cc: Thomas Petazzoni , Mark Yacoub , Sean Paul , Louis Chauvet , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Simona Vetter , Kory Maincent X-Mailer: b4 0.14-dev-d4707 X-Last-TLS-Session-Version: TLSv1.3 intel_lvds_init() had a goto-based error path that manually called drm_connector_cleanup(), drm_encoder_cleanup(), kfree() and intel_connector_free() when no LVDS panel mode could be found. Once drm_connector_init_with_ddc() and drm_encoder_init() have been called, the DRM core takes ownership of these objects and will invoke their .destroy callbacks (intel_connector_destroy and intel_encoder_destroy) during device teardown. The manual cleanup in the failed: label is therefore redundant. Remove it and replace the goto with a simple early return. Fixes: 79e539453b34e ("DRM: i915: add mode setting support") Signed-off-by: Kory Maincent --- Not tested as I don't have such hardware. --- drivers/gpu/drm/i915/display/intel_lvds.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index cc6d4bfcff102..e78a41e2b268c 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -991,8 +991,10 @@ void intel_lvds_init(struct intel_display *display) mutex_unlock(&display->drm->mode_config.mutex); /* If we still don't have a mode after all that, give up. */ - if (!intel_panel_preferred_fixed_mode(connector)) - goto failed; + if (!intel_panel_preferred_fixed_mode(connector)) { + drm_dbg_kms(display->drm, "No LVDS modes found, disabling.\n"); + return; + } intel_panel_init(connector, drm_edid); @@ -1005,12 +1007,4 @@ void intel_lvds_init(struct intel_display *display) lvds_encoder->a3_power = lvds & LVDS_A3_POWER_MASK; return; - -failed: - drm_dbg_kms(display->drm, "No LVDS modes found, disabling.\n"); - drm_connector_cleanup(&connector->base); - drm_encoder_cleanup(&encoder->base); - kfree(lvds_encoder); - intel_connector_free(connector); - return; } -- 2.43.0