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 0CE8223BF8F; Mon, 2 Jun 2025 14:11:33 +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=1748873494; cv=none; b=FcMvZ0NhZbEeGYyikfwDXCBn7LEXjveDeeCrOlcUsr8XJn+2JaesL2R9+TD5t3sBUXSTcyGDE7J/aVQhRKmSk64mvVVC5zi/yjAYMEXBSSX7v3jQ05XzyFVQgLb+4rUkmnY/70HRpssw5cX8L+p2El6TGcnqryA96NWFAy8gNks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748873494; c=relaxed/simple; bh=MpOhz58COfbgZjWrOsWvpf0sL7+6YpYxc+xjXfPacak=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=btmTr17qtdntyfsH/eoE4tr+ulsT1H4TEyEWnVbItAXDkxVk8qr0yOcDUJ92fQQClMmS8vhTvsw8BdvicEQp6MijRZ/DLiGMRyFN3txJsj7y5rrgXUoxRMKIViiK6ualUbkS83QuIiba2owggNhYCzaHZfBv0EE9cJQ+WIqsB7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fobQxFJa; 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="fobQxFJa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D97DC4CEEB; Mon, 2 Jun 2025 14:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748873493; bh=MpOhz58COfbgZjWrOsWvpf0sL7+6YpYxc+xjXfPacak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fobQxFJa6G3frQsTULmdOMmG+USw9JrJGYcPIux0p+/s81E66W4cMoZtkM7NYB48B vWJHUuNtUqr7mNdoEcHfNzJ8RsXetSX3rB6ExkQB6XqJ0pm/ZmtJaNI74SDhi0kKir /ZMZh+1fjwNYVd7Y05JovAaZtOl9+5GP/oUcZH1M= 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 6.6 141/444] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe() Date: Mon, 2 Jun 2025 15:43:25 +0200 Message-ID: <20250602134346.620604771@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134340.906731340@linuxfoundation.org> References: <20250602134340.906731340@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 6.6-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/st/sti/c8sectpfe/c8sectpfe-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c index 5dc1f908b49bd..9aa484126a0dd 100644 --- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c @@ -806,13 +806,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); /* Acquire reset GPIO and activate it */ tsin->rst_gpio = devm_fwnode_gpiod_get(dev, -- 2.39.5