Skip to content

Commit 02f1784

Browse files
elfringjfvogel
authored andcommitted
media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe()
[ 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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 5520fed18df866d7821fbde9549c6cb7beb096ee) Signed-off-by: Jack Vogel <[email protected]>
1 parent c68c43a commit 02f1784

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,13 +797,12 @@ static int c8sectpfe_probe(struct platform_device *pdev)
797797
}
798798
tsin->i2c_adapter =
799799
of_find_i2c_adapter_by_node(i2c_bus);
800+
of_node_put(i2c_bus);
800801
if (!tsin->i2c_adapter) {
801802
dev_err(&pdev->dev, "No i2c adapter found\n");
802-
of_node_put(i2c_bus);
803803
ret = -ENODEV;
804804
goto err_node_put;
805805
}
806-
of_node_put(i2c_bus);
807806

808807
/* Acquire reset GPIO and activate it */
809808
tsin->rst_gpio = devm_fwnode_gpiod_get(dev,

0 commit comments

Comments
 (0)