Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2381958lqp; Sun, 24 Mar 2024 16:57:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXoN2ZkZEQy6eCTabZxmw283opnNvZG5m5TtMBzyW8ODXqbNEDVG7OnTljohBupRpKqND1LrRsq7BVk8NWSzcc7/4IfA7EwsUYGqOpLWw== X-Google-Smtp-Source: AGHT+IFAgYnTmA5OQPrwp/IRAnsrz9J19XVs6o0KEaNNBmB5Axn/ZhqFYaDhSE9slSlxFd8aKF5t X-Received: by 2002:a05:6358:33aa:b0:17f:4964:3e04 with SMTP id i42-20020a05635833aa00b0017f49643e04mr7068570rwd.10.1711324647015; Sun, 24 Mar 2024 16:57:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711324646; cv=pass; d=google.com; s=arc-20160816; b=N0w+qpjG4Y3dx8FqmaGnGD/GHRHqOEpBKjDZcCya7uKv/S8FGnUGGjhyFEptVPTDGw LwMmHj0e55eDbtD1CtcfPlDOnx04vgLmLIGqmYmcfDmaeWJbRIqU+lBUbYPcyjCjghgJ XH/zEuQoKTm1elatk5KjFCbcBqoirqHqBO9WfeoVYZvWZlondOFEXBGvPOIT2ZoPjv5x IWlt8ZaDdzxvVu1d4k1rSWf1HFqaNiwNmyl0hirUmOdKIcm9xJjNBD760Ou5s+8MOb3G MEK+jx+14F4hJV83t3pLdMBRu1UVpBbGJEdewikJLCUcyV6g8w8SVczpt+4uMUPe++Es QM2Q== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JLBcaJXsarOW+yD1D8QG9Hp8Xw8GI/zNryfk0aFMysc=; fh=4RGyyjZTpuBUGR1TesKnLTwS9HCKIISg2vxTmZH992k=; b=MKzbySCYrT+N9qOan0RUhjjcDkfozf5gJVJ6rkmGlFv0CMw7aaDe1mbaf/DDY8XL34 ZiMDEocWmi8oBZFwkHY++O9j459/aQiZYqnrBdVbkHNmPYTnQwSwPY1CRl1L6F0vfVEN vytRvLK50Kz29JjxBGrTiwHFhZs8rkyBew253T4vs+sft/IwOKfgxCn87aArUJGLcjjJ WAsJvzfLKXaT/dqUsNIRth1oCWmbgOFxv9czX443MGcgZZ2qYph9SMtGFyIKpDkkZxDC TrTLVUmBcXWSFSyT+LZyGJdTaplCFILIA/De1O96/3kDM1ruBiSt3avRuNQehf9aWUpP 3zpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jyyJcj0E; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113246-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113246-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 11-20020a63104b000000b005dbf22da2c6si6517077pgq.61.2024.03.24.16.57.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:57:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113246-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=@kernel.org header.s=k20201202 header.b=jyyJcj0E; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113246-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113246-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 DF4E4285625 for ; Sun, 24 Mar 2024 23:53:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81254186370; Sun, 24 Mar 2024 22:40:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jyyJcj0E" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 97DC713C9D0; Sun, 24 Mar 2024 22:40:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320046; cv=none; b=QXnHaTGaYPCnUlsT3v0u9fVtCBs14ITxpAwyxnrCYcfGAYfFekDpV25TXNRUcT9htEm8E6L/0jB4zq0Jm2dXnmhl9fzSGiS9K7tsIriMAtsJ8mq9QVE0kqOC3MXAgf1AJZOQzKFVU8nOj8fIcXdilE1kxgyuQHp3fkimWMTeW4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320046; c=relaxed/simple; bh=+vKf/AD+EU5ShwD9w5bCge7Hc87d+rNN8o9xeCJe6BY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lP5PyN0nDNQepbkracX/si1tEO/WLQkh3BjLLRtbAdv3isVs3yVhQRm1nMWpX1LtAQ/0uG8N96ACjhsbQ/Tvj81l1PaV/Muj9A9Vo0yTlxPy2RfGGrPRpzMG1FgBYB+/V/DT/APT7oM952SqVzVeniMKHJlHotdhBY5YcvA0mQ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jyyJcj0E; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADE58C433C7; Sun, 24 Mar 2024 22:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320046; bh=+vKf/AD+EU5ShwD9w5bCge7Hc87d+rNN8o9xeCJe6BY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jyyJcj0E3jCPCdvdCnzFmTJ8rmf1rLKX7r7SdFRXcif3esiDtcP77n47APsczLFRZ KboKzx5ZV/pyMjzZHDytmLGOJY5TeOI5cbte9/ZZ3u7l6UvxQUUSuISlXwnJ7igjwI 0y1SCmeyzvlH1hQawzRl2/s7mhhBDdhv/80eouEKFM3TpNlu6KWnwEPenjBEOuuB/e ixuQI/UMh5v+YsWzIdn+oHPJuslIK8pjrQztnXfaWd1fu4B7NoOU4pjxXx51LNtn1R aaMusXO+vS1uyeLSl9egaMKOvD+KyY2L+t+XUkCCi09Awob5mhMJv3bcV3MK9KfZfP 2OyhBqhU71OEA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe JAILLET , Thierry Reding , Sasha Levin Subject: [PATCH 6.8 355/715] drm/tegra: rgb: Fix some error handling paths in tegra_dc_rgb_probe() Date: Sun, 24 Mar 2024 18:28:54 -0400 Message-ID: <20240324223455.1342824-356-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Christophe JAILLET [ Upstream commit bc456b5d93dbfdbd89f2a036f4f3d8026595f9e4 ] If an error occurs after calling tegra_output_probe(), tegra_output_remove() should be called as already done in the remove function. Fixes: 59d29c0ec93f ("drm/tegra: Allocate resources at probe time") Signed-off-by: Christophe JAILLET Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/0001f61eb89048bc36241629b564195689cf54b6.1693667005.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/gpu/drm/tegra/rgb.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c index fc66bbd913b24..53c492b13d129 100644 --- a/drivers/gpu/drm/tegra/rgb.c +++ b/drivers/gpu/drm/tegra/rgb.c @@ -225,26 +225,28 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc) rgb->clk = devm_clk_get(dc->dev, NULL); if (IS_ERR(rgb->clk)) { dev_err(dc->dev, "failed to get clock\n"); - return PTR_ERR(rgb->clk); + err = PTR_ERR(rgb->clk); + goto remove; } rgb->clk_parent = devm_clk_get(dc->dev, "parent"); if (IS_ERR(rgb->clk_parent)) { dev_err(dc->dev, "failed to get parent clock\n"); - return PTR_ERR(rgb->clk_parent); + err = PTR_ERR(rgb->clk_parent); + goto remove; } err = clk_set_parent(rgb->clk, rgb->clk_parent); if (err < 0) { dev_err(dc->dev, "failed to set parent clock: %d\n", err); - return err; + goto remove; } rgb->pll_d_out0 = clk_get_sys(NULL, "pll_d_out0"); if (IS_ERR(rgb->pll_d_out0)) { err = PTR_ERR(rgb->pll_d_out0); dev_err(dc->dev, "failed to get pll_d_out0: %d\n", err); - return err; + goto remove; } if (dc->soc->has_pll_d2_out0) { @@ -252,13 +254,17 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc) if (IS_ERR(rgb->pll_d2_out0)) { err = PTR_ERR(rgb->pll_d2_out0); dev_err(dc->dev, "failed to get pll_d2_out0: %d\n", err); - return err; + goto remove; } } dc->rgb = &rgb->output; return 0; + +remove: + tegra_output_remove(&rgb->output); + return err; } void tegra_dc_rgb_remove(struct tegra_dc *dc) -- 2.43.0