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 D53181D516F; Mon, 2 Jun 2025 14:32:08 +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=1748874728; cv=none; b=sm0wyUCCSoZEyLJEMWYwJiVt1XQVDc9BWH9OuO0aJ0YZ2RTM7Hqb885NqTsBfeaYs4Cz4/sqFjt6kJAYUV58UdCOMPJatXbSEecL5KvePb7i1gX0CQ4W8yC/wbsSMcqLG1gn+rDoieSj/+sbREpvCRsPTObh4zEl9G1U7DmwDCI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748874728; c=relaxed/simple; bh=AwW4NVGptndbvEijpHxTHpFw4FTqw9datH4Z0cGJ6cc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ewbFuBbab8mM/xWzQpkGA5aSFxGxQ5NCDVdaadP36xbLsJFGXE4xPqb5VYe2fOP7J3hbhuNaJ1aYofgwFAbE5HLb4ZN3Y4tg9lGdSb2LPlKlO1Fjop6sa0rmf0NQ+OT7ihGf8vcX0zjaoUBNfZY8nHSPxS95SUgDO4RQrjgvIrE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1FGQDu45; 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="1FGQDu45" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55CDCC4CEEB; Mon, 2 Jun 2025 14:32:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748874728; bh=AwW4NVGptndbvEijpHxTHpFw4FTqw9datH4Z0cGJ6cc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1FGQDu45WJk1tc9KQBXAdyM1RMYZPdrWKR6dyhM+TFzBwJl2HmScMNpv8yqLy+jg9 nxFW8LMyrD5NPe0Lz5qzIc7OivVDGE0Qvyd23QYKBTMYmPMIBD4E0Rs/yH89Ssc+pm /XqtzTqDEJnHNMOidJMq+IhQVpI+H2eFz2ywH2SE= 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.4 118/204] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe() Date: Mon, 2 Jun 2025 15:47:31 +0200 Message-ID: <20250602134300.292015270@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134255.449974357@linuxfoundation.org> References: <20250602134255.449974357@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.4-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 69070b7068318..8229fbb88a8db 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -813,13 +813,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_clk_disable; } - of_node_put(i2c_bus); tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0); -- 2.39.5