From mboxrd@z Thu Jan 1 00:00:00 1970 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 32C381EA65; Mon, 2 Jun 2025 14:54:45 +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=1748876085; cv=none; b=l3G2P24k6AVnPpz7Iw+Ml/OGFZQ5INmIAy/ENl93HwcyqLvxaOTDgWjjsNo6fEpFn6y6dfRR0i09MjHQvzshPGbCT37smu+Nh+hQivPHzp9WPbf3xpMtgOoiSqLk6zJ4267uUKFeOd68qy8PnsaMYoh8IEMet+DBpGN/7KGGkMw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748876085; c=relaxed/simple; bh=DAPaaEYNpGOxvM2j6J39ZDSGB5ZWY6nMJdu3Ir9ngwg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lMCzqePWvP1dnEsKzde4QqLpozcEU1VLa4X2RnfooabEROz0GSuU/CNElDBng4GkiSgVG26SD8bYucKJPEo2aI3nR+n0G0Kb6Ta1KEpyrQP0UT3ZImSQBnywd2Oj1o+okIywWjUYZgLA5qmjY1nGlW/tXIXziaENxnBbNbn5MIc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pyNhisC2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pyNhisC2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0BE3C4CEEB; Mon, 2 Jun 2025 14:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748876085; bh=DAPaaEYNpGOxvM2j6J39ZDSGB5ZWY6nMJdu3Ir9ngwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pyNhisC2bQoKAyBs1u2Pt6NdS340oDGBME/4FgwR+0Qq+TOJfTIk89fUdsYu6/k4a XYiCOP6Ey/GBVbGPVm8SddUMfxdO2RGK+rvs/toto+YHI2hML4XPRFEmqnEBd8EedQ t3k/M5uZMXEn+N1pwgkFWk21CABzSpR36CS7Xfh4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Markus Elfring , Hans Verkuil , Sasha Levin Subject: [PATCH 5.15 067/207] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe() Date: Mon, 2 Jun 2025 15:47:19 +0200 Message-ID: <20250602134301.365733937@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134258.769974467@linuxfoundation.org> References: <20250602134258.769974467@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Markus Elfring [ Upstream commit b773530a34df0687020520015057075f8b7b4ac4 ] An of_node_put(i2c_bus) call was immediately used after a pointer check for an of_find_i2c_adapter_by_node() call in this function implementation. Thus call such a function only once instead directly before the check. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 88d0188397e7b..28aab5a8336e0 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -811,13 +811,12 @@ static int c8sectpfe_probe(struct platform_device *pdev) } tsin->i2c_adapter = of_find_i2c_adapter_by_node(i2c_bus); + of_node_put(i2c_bus); if (!tsin->i2c_adapter) { dev_err(&pdev->dev, "No i2c adapter found\n"); - of_node_put(i2c_bus); ret = -ENODEV; goto err_node_put; } - of_node_put(i2c_bus); tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0); -- 2.39.5