From nobody Wed Feb 11 06:56:56 2026 Received: from msa.smtpout.orange.fr (msa-210.smtpout.orange.fr [193.252.23.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCB7B1CAB0; Mon, 20 May 2024 09:34:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.252.23.210 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716197693; cv=none; b=n+vXu8IyKCuMl7ygIYR6VNNgfsTjRT5g+NnHkDn4yT6ENSLplhb5/4g8e716YvUAib7BD/UFNahUkwc0AJ6CcYz3VELfTks7q8JYRYKI5DcHwexk59Q92gNWFC6VvYgITdKlUZHqCRj1TvrLbsLnm1POQ5IG1c3CY1RJ+NL4CHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716197693; c=relaxed/simple; bh=+77XyCRDxsBQltBH9jjJSzxn9eZ4P3Vh9uHJPjCD1eY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CXMMw/MhpeosV5fcKi/5gTeC1WyJrUdTyVnZEogw3bW5NL3dIdVyVNixt03pFgMZ4/LnZrIUMjaTQggTyvqAVZ0KsaVTVlVbFN0RVwD673Vgn98KIkFANdqGs7blIrJnLFBk/yUaHjkbQL5cWMxK8io4XfkcnPriH/218iUWz0Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=oTUzr4Cg; arc=none smtp.client-ip=193.252.23.210 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="oTUzr4Cg" Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 8zPjslTpy8GJA8zPjsKGeh; Mon, 20 May 2024 11:34:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1716197683; bh=bGqQuOEblhAm3peYnZztYMLeh0ncPzzrHa3zUm2ihUg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=oTUzr4CgJ6FLx6ZgfRHMG1ly1+nqheFVnGDh8WEpzjTwnS6lXkT48+ruiXWnaZzLM tB8onbUJyl/Cr/5Ws+TElQS8zZaHT4wJuirCmcDnUNAyDAQTKTXCduuWcBwDs4UEic vaWqvbPozYOxYMNrOby0imhcE/uRcyrUJp13y1Pk1JlnXUx5Re7qmM9FJtew+wqouc 5VnuiqU5RGZKWOwtNBuAtQjLLOl1vKSJOyc0d15Pikiaq+sOZl8cxVtIEPw0hrnkDR 664iNHRCDMI8Nmnr63+GfbXwGuvwWVQmLGFnxUqrhHehwyvRLId4X17qMFDNz1+8bz ZaYljy5npEpMA== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 20 May 2024 11:34:43 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: Sumit Semwal , Caleb Connolly , Neil Armstrong , Jessica Zhang , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Vinod Koul , Dmitry Baryshkov , Marijn Suijten Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Caleb Connolly , dri-devel@lists.freedesktop.org Subject: [PATCH] drm/panel: lg-sw43408: Fix an error handling path in sw43408_probe() Date: Mon, 20 May 2024 11:34:31 +0200 Message-ID: X-Mailer: git-send-email 2.45.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" If mipi_dsi_attach() fails, we must undo the drm_panel_add() call hidden in sw43408_add(), as already done in the remove function. Fixes: 069a6c0e94f9 ("drm: panel: Add LG sw43408 panel driver") Signed-off-by: Christophe JAILLET Reviewed-by: Dmitry Baryshkov --- Compile tested only --- drivers/gpu/drm/panel/panel-lg-sw43408.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/pan= el/panel-lg-sw43408.c index 115f4702d59f..27f2ad788d38 100644 --- a/drivers/gpu/drm/panel/panel-lg-sw43408.c +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c @@ -286,7 +286,15 @@ static int sw43408_probe(struct mipi_dsi_device *dsi) =20 dsi->dsc =3D &ctx->dsc; =20 - return mipi_dsi_attach(dsi); + ret =3D mipi_dsi_attach(dsi); + if (ret < 0) + goto err_remove_panel; + + return 0; + +err_remove_panel: + drm_panel_remove(&ctx->base); + return ret; } =20 static void sw43408_remove(struct mipi_dsi_device *dsi) --=20 2.45.1