diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2024-10-04 15:50:15 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2025-03-06 17:28:28 +0100 |
commit | b773530a34df0687020520015057075f8b7b4ac4 (patch) | |
tree | 658852efdfd2dd2248f4f3d048fb3d530db4d41c /drivers/media | |
parent | b50231ff015ee223732a4783eda954609369076c (diff) |
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>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c index 7b3a37957e3a..d151d2ed1f64 100644 --- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c @@ -797,13 +797,12 @@ static int c8sectpfe_probe(struct platform_device *pdev) } tsin->i2c_adapter = of_find_i2c_adapter_by_node(i2c_bus); + of_node_put(i2c_bus); if (!tsin->i2c_adapter) { dev_err(&pdev->dev, "No i2c adapter found\n"); - of_node_put(i2c_bus); ret = -ENODEV; goto err_node_put; } - of_node_put(i2c_bus); /* Acquire reset GPIO and activate it */ tsin->rst_gpio = devm_fwnode_gpiod_get(dev, |