Skip to content

Commit edc0be8

Browse files
elfringopsiff
authored andcommitted
media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe()
[ Upstream commit b773530 ] 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 d5f8c8ec1e783aa713118cc905660eb82b3f8aa6)
1 parent b7e17ee commit edc0be8

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
@@ -806,13 +806,12 @@ static int c8sectpfe_probe(struct platform_device *pdev)
806806
}
807807
tsin->i2c_adapter =
808808
of_find_i2c_adapter_by_node(i2c_bus);
809+
of_node_put(i2c_bus);
809810
if (!tsin->i2c_adapter) {
810811
dev_err(&pdev->dev, "No i2c adapter found\n");
811-
of_node_put(i2c_bus);
812812
ret = -ENODEV;
813813
goto err_node_put;
814814
}
815-
of_node_put(i2c_bus);
816815

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

0 commit comments

Comments
 (0)