From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 27FC432E120 for ; Tue, 10 Feb 2026 10:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770720263; cv=none; b=XU4oB8OrsKLUBxMuEKHo/I1b36GLNSWdTKk4RsHFKyDavAcTm+GhLQtP0Hd7LIGo93oZQM4qKUfpB7sYzLZik5okYkFPGyjk1cz5rWgI+CeIv4jzCf98Ud6IxQ0PgFEjUXTMnYOnwI8d7zvloK91dFegnz6bjUbLq8ZHiZH+2dY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770720263; c=relaxed/simple; bh=TeT8fFaQDNGxM84WrlNaLg8VOUAzH6x6QlmmFTijl3M=; h=Mime-Version:Content-Type:Date:Message-Id:To:From:Subject:Cc: References:In-Reply-To; b=kF5b8Jrdpn2xJoPR72gy5eQ+mm7r7c9OZcSqsUqYAHJok0bsLM9HVt7RX5eOv6ZannJhf6kNL++WckFXfpiJt8rcl2DQS74/42vmNdpoZf9/iZAXOs6OnFpJODAJsvZO57yZwWAYntz5lh2439kJfn6QUlRTCvUEiEs6RpVapxI= 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=n3JSbTNz; arc=none smtp.client-ip=185.246.85.4 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="n3JSbTNz" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 4ADBC4E40BC5; Tue, 10 Feb 2026 10:44:19 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 03B6A606BD; Tue, 10 Feb 2026 10:44:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 35628119D1118; Tue, 10 Feb 2026 11:44:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1770720257; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=rgIZKpgJemM2O7tuO8K6vUcedAgz0oWF401av9M9oVc=; b=n3JSbTNzPPfJM80F/e/8JHK/PLG6zjf37tfVMjKnZYMhvuMrbw+0KmWFM6LCcaoSvdp1zW L7Zc0a2KN806lX4XRiSL2ul+0I4OYgYssPNrlLIiBMoVkXla5L07BnhnQUCXO0v0r7gsC+ RFSv5GXp5LcbmZGzFv5tTZwK2j7zqhuvI0iWFgeI49pT3+IfcB77lionxNxp8txH6otmLU WJaONHLOTQVq080OME35wHuksw66On1DSxoepctGmq+EjHQFlOOzrWy2TliVIn8yr9T78B mEbkbdUfrLg4flbTtpKjsgKWyX0FSsfKt4g0743yTcFBGvPfvUxZP2j5pyJyHg== 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 Date: Tue, 10 Feb 2026 11:44:11 +0100 Message-Id: To: "Osama Abdelkader" , "Inki Dae" , "Jagan Teki" , "Marek Szyprowski" , "Andrzej Hajda" , "Neil Armstrong" , "Robert Foss" , "Laurent Pinchart" , "Jonas Karlman" , "Jernej Skrabec" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Marek Vasut" , , From: "Luca Ceresoli" Subject: Re: [PATCH] drm/bridge: samsung-dsim: Fix memory leak in error path Cc: X-Mailer: aerc 0.20.1 References: <20260209184115.10937-1-osama.abdelkader@gmail.com> In-Reply-To: <20260209184115.10937-1-osama.abdelkader@gmail.com> X-Last-TLS-Session-Version: TLSv1.3 Hello Osama, On Mon Feb 9, 2026 at 7:41 PM CET, Osama Abdelkader wrote: > In samsung_dsim_host_attach(), drm_bridge_add() is called to add the > bridge. However, if samsung_dsim_register_te_irq() or > pdata->host_ops->attach() fails afterwards, the function returns > without removing the bridge, causing a memory leak. > > Fix this by adding proper error handling with goto labels to ensure > drm_bridge_remove() is called in all error paths. Also ensure that > samsung_dsim_unregister_te_irq() is called if the attach operation > fails after the TE IRQ has been registered. > > samsung_dsim_unregister_te_irq() function is moved without changes > to be before samsung_dsim_host_attach() to avoid forward declaration. > > Fixes: e7447128ca4a ("drm: bridge: Generalize Exynos-DSI driver into a Sa= msung DSIM bridge") > Cc: stable@vger.kernel.org > Signed-off-by: Osama Abdelkader > --- > v2: Please add the version number to the e-mail Subject, it should be: [PATCH v2] drm/bridge: ... ^^ No need to resend just for this, but please keep it in mind for the future. Using b4 automates all of this very nicely, you can consider using it. Reviewed-by: Luca Ceresoli -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com