From nobody Thu Feb 12 17:29:13 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3EE3115B3 for ; Mon, 10 Jun 2024 10:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718015294; cv=none; b=Cfj0/bV4XVbTr9oY/jN7azaw+N4ZeOLa+NzU88L0dJY47K1gipRG1aFjAlEI6FI+KlPf8r8ptEL9N58CyC9nSgiGNT3Co4KD92xREVeoUvL5Ktec9mh/9pUU84Azo5+InWcG9pB9N3fQhgw7Vl/EeiGNopa4GljgmMvQSCBiLjE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718015294; c=relaxed/simple; bh=59vqSNo8efv80hHanD7EjByevBNH4rkg7/y6UCfmSng=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=nG8mODK/TUxOFHu2/FzI3MKjGZg35s/+0pyUGRisKs7nil6M8ExnMODn7+DvcRtNkdm7sm6rYNPYy+VqJDDLlvyCZPJJ5s/WkEsp2EUS153Waqo1EF367xD/mnTenWKwvhrSBzgpqXUn6o7yC5wGRai5RBhSZtFlpcDM9plCU3U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1D43D1688; Mon, 10 Jun 2024 03:28:36 -0700 (PDT) Received: from e128090.cambridge.arm.com (unknown [10.1.198.24]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A54FC3F73B; Mon, 10 Jun 2024 03:28:09 -0700 (PDT) From: Adam Miotk To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Adam Miotk , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Smitha T Murthy , Deepak Pandey Subject: [PATCH] drm/bridge/panel: Fix runtime warning on panel bridge release Date: Mon, 10 Jun 2024 11:27:39 +0100 Message-Id: <20240610102739.139852-1-adam.miotk@arm.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Device managed panel bridge wrappers are created by calling to drm_panel_bridge_add_typed() and registering a release handler for clean-up when the device gets unbound. Since the memory for this bridge is also managed and linked to the panel device, the release function should not try to free that memory. Moreover, the call to devm_kfree() inside drm_panel_bridge_remove() will fail in this case and emit a warning because the panel bridge resource is no longer on the device resources list (it has been removed from there before the call to release handlers). Signed-off-by: Adam Miotk --- drivers/gpu/drm/bridge/panel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 32506524d9a2..fe5fb08c9fc4 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -360,9 +360,12 @@ EXPORT_SYMBOL(drm_panel_bridge_set_orientation); =20 static void devm_drm_panel_bridge_release(struct device *dev, void *res) { - struct drm_bridge **bridge =3D res; + struct drm_bridge *bridge =3D *(struct drm_bridge **)res; =20 - drm_panel_bridge_remove(*bridge); + if (!bridge) + return; + + drm_bridge_remove(bridge); } =20 /** --=20 2.25.1