Skip to content

Commit b773530

Browse files
elfringhverkuil
authored andcommitted
media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe()
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 <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
1 parent b50231f commit b773530

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)