Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2334908lqo; Mon, 20 May 2024 02:35:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXS3Z5R8JRlsYuVC0d9SYvee19gJQigEPg98TbD+7dQmcZl/IaIzAGv+pYlLHH+y6liA1uU1rLP0mHC0j/gTI8e7rYERJ0r6Sq+lCKxWw== X-Google-Smtp-Source: AGHT+IHaCYgwlovbCGoIkvTAXZY2/V9s4Zd+AfGxRg32rcpjzR68ju4xm33yz5ChTLFWzhlijo8m X-Received: by 2002:a05:6358:71c:b0:18f:673e:fce2 with SMTP id e5c5f4694b2df-193bb4ff332mr2883320755d.6.1716197703627; Mon, 20 May 2024 02:35:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716197703; cv=pass; d=google.com; s=arc-20160816; b=bJYA6PxMaQ031F4qb9j5dbcKrAgOjOSZ9x6eO2njr/mQsWRHxcoui7M59rBJX9xHog +wRmt/tCTRJwXakareqRedyV/2L9xsVTdQ//bwjNjQ4U7g2PeIDxOufrXrwYRrKbkdl3 eOwGScM7HOnwWqdc4wy3Fw37jXWjLe3sW00iVMldAR8D0J3Vc3fUfvqF2ltkd1GKeE0g NfOGudQJeNcVLdNb6zkfuuIEaTyMAJjpGhF7LsnrYREHxp7WGDvK1lljM8Ad5zsezYrS 7P/bvyiCuu5RNHovSfAGy2xnHhHGGwhRqMdQwSsoqAfY9vjU7h/57/1mOODwc2RCZpsI Xu+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=bGqQuOEblhAm3peYnZztYMLeh0ncPzzrHa3zUm2ihUg=; fh=AIO4TZUIlAy5Zl0Hf5GKjsHnawasiw3oTy/kR6dUSnw=; b=OsFSLOPRuS8mTkD4dm3FuQv8vEHlA64ZP3RcsRc2+U9Z8hspsJqJJmLugPpvKOkVEm uiO02DG82keLOP/zq7doRW0kXT3+E5OZDf04IaqtilMM3pI2Iywh/oMIHgQ+RldSKsgL MV7PhiUZboGBoheefWyKANsnLmdL0JNubEkGH7qAasoI3CQvXOMCqQeqE9Th7RLEVwhv eACp0217cBNURvQ2b88hIYO3gYQonFB0j3pj+Y4nBALnN9PjakOn16cstpF3KvgYWw3G gD/P+dAowlaO3p/e9Kg5EmakELhrU+yNfuxPE4ZqKLwq7l64hYTs0X2UzsNnRvP80o5K f6bw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=oTUzr4Cg; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-183543-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412863eaesi21961163a12.637.2024.05.20.02.35.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 02:35:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183543-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=oTUzr4Cg; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-183543-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B41142821DB for ; Mon, 20 May 2024 09:35:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8B01200C7; Mon, 20 May 2024 09:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="oTUzr4Cg" 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 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: 8bit 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 --- 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/panel/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) dsi->dsc = &ctx->dsc; - return mipi_dsi_attach(dsi); + ret = mipi_dsi_attach(dsi); + if (ret < 0) + goto err_remove_panel; + + return 0; + +err_remove_panel: + drm_panel_remove(&ctx->base); + return ret; } static void sw43408_remove(struct mipi_dsi_device *dsi) -- 2.45.1