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 A61CB280303; Tue, 27 May 2025 16:56:02 +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=1748364962; cv=none; b=E6K8XD1uEvG6fp7ynWr0M0H5MU74Q7OkJ8UsudpB3xYeqi/R/w6EIDcHVATzVeT3T4rvIPEqQp+Rdlo4QeGutkTQQy7XLpmQmEkxoI1dHvMqVUVn01NSWYD9cpptiMlbxaPhKqonMvW4JOz8r7TukQITKL0qkgonB7vgw8qdFBs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748364962; c=relaxed/simple; bh=RdXAmDNvuZKH8h235Hia7xxWXo56n29LEi+xFhmgbM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MMKjxDStvKcJuLIU3yjql+wBUPvP8O6Geq8Z4CaqoQ59ICglMGvpuoTGuR5uAJAlEI2PCeBmx6w931NfrTHX2DPHkZ20BWvvfJJrM4NkiSZxcklj3TpnyIStIfAL1LtxkTuuNuj9cPKfKPF1MLWv0UnhdB+Jzii4975sJaHdJjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1bXz+pKL; 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="1bXz+pKL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF04AC4CEE9; Tue, 27 May 2025 16:56:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748364962; bh=RdXAmDNvuZKH8h235Hia7xxWXo56n29LEi+xFhmgbM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1bXz+pKLD07kaAhRqhoWO62gDcpJyOq75616KPCZfdMmFW+cAEEc6p0qyF8AIVVVB EC3oh5ThddoqazeyahbU/oC3QeSo67Dqgo8qfuclZf68+XpjCWB/mzuYKuy4tGF5Qj QdvkdjrYr86ZWpcA9CAe7z7IE78OOjS6ZWVuoGvA= 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.12 223/626] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe() Date: Tue, 27 May 2025 18:21:56 +0200 Message-ID: <20250527162454.075919102@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162445.028718347@linuxfoundation.org> References: <20250527162445.028718347@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.12-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 67d3d6e50d2e2..ed3a107965cc9 100644 --- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c @@ -797,13 +797,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