Skip to content

Commit 9e11ff5

Browse files
elfringgregkh
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]>
1 parent d554d68 commit 9e11ff5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,13 +811,12 @@ static int c8sectpfe_probe(struct platform_device *pdev)
811811
}
812812
tsin->i2c_adapter =
813813
of_find_i2c_adapter_by_node(i2c_bus);
814+
of_node_put(i2c_bus);
814815
if (!tsin->i2c_adapter) {
815816
dev_err(&pdev->dev, "No i2c adapter found\n");
816-
of_node_put(i2c_bus);
817817
ret = -ENODEV;
818818
goto err_clk_disable;
819819
}
820-
of_node_put(i2c_bus);
821820

822821
tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0);
823822

0 commit comments

Comments
 (0)