Skip to content

Commit 512c320

Browse files
elfringsmb49
authored andcommitted
media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe()
BugLink: https://bugs.launchpad.net/bugs/2115678 [ 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 <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent 6071be1 commit 512c320

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)