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 1D18722ACF3; Mon, 2 Jun 2025 14:46:16 +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=1748875576; cv=none; b=ewWye7wWcXSU8P3JQIHPuCvu0QqKWXk1a//GZN4TAbLcwZtaUeHLJT4MIHUCSS5emZWr1K6DDGNYUiKADaivpWs4huMVMTCuSz0Ir6/VLjR5SF1nD9q6kTEdKRDkaF5Hpby9M/O86Dusmi2nOMSusFw/4YmGKg1JqJba4eVWalI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875576; c=relaxed/simple; bh=ARsr/HL+UJ3CFrofaub9KSVFP+oiUijq+gtBxX5M5TU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LDwkpWmUjfTRm5MVGUFLqgM6ydsGjk6Oc9g6WN/wEp5AgNlJw6Jhy5zubvPQxNGzz+YZaER8Y0+94EkteV8SvEFC+Suegq+WN/CzR+o/Liz3KaNTH2kREvQ53wClhZ2L1S8d5O3Fb0Q2fBLeDDvjidldcU7FA40GdR8BJIuLBuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=t+q6pNr3; 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="t+q6pNr3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98B89C4CEEB; Mon, 2 Jun 2025 14:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748875576; bh=ARsr/HL+UJ3CFrofaub9KSVFP+oiUijq+gtBxX5M5TU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t+q6pNr3xbtDPR/g5gc8kv0+S+fAj/LPBtOGqaI+pYnFl82HGV/CBI+dGjbl4LsXx xglTgIy+4jI36duAa5FVakGi70UGtgfn1YLjlonn9UBZyiQ6FZBipcq57FmjhOp0/s L7dQqVP2XFMsmzXCBwf5Vv7kEy4JU4kx9UaIOdTk= 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.10 160/270] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe() Date: Mon, 2 Jun 2025 15:47:25 +0200 Message-ID: <20250602134313.751829381@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134307.195171844@linuxfoundation.org> References: <20250602134307.195171844@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.10-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 b7e0ec265b70c..6e3b3643a2cdb 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_clk_disable; } - of_node_put(i2c_bus); tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0); -- 2.39.5