media: ipu3-cio2: Drop reference on error path in cio2_bridge_connect_sensor()
Subsystems (2)
PATCH 1/1 media: ipu3-cio2: Drop reference on error path in cio2_bridge_connect_sensor()
The commit 71f642833284 ("ACPI: utils: Fix reference counting in for_each_acpi_dev_match()") moved adev assignment outside of error path and hence made acpi_dev_put(sensor->adev) a no-op. We still need to drop reference count on error path, and to achieve that, replace sensor->adev by locally assigned adev.
Depends-on: fc68f42aa737 ("ACPI: fix NULL pointer dereference")
--- drivers/media/pci/intel/ipu3/cio2-bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/intel/ipu3/cio2-bridge.c +1 -1
@@ -226,7 +226,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, err_free_swnodes:software_node_unregister_nodes (sensor->swnodes); err_put_adev: -acpi_dev_put (sensor->adev); +acpi_dev_put (adev);return ret; }
Signature · 1 line
2.30.2
Sakari Ailus
maintainerHi Andy,
Quoted 19 lines · Andy Shevchenko
The commit
71f642833284("ACPI: utils: Fix reference counting infor_each_acpi_dev_match()") moved adev assignment outside of error path and hence madeacpi_dev_put(sensor->adev)a no-op. We still need to drop reference count on error path, and to achieve that, replacesensor->adevby locally assigned adev.Fixes 71f642833284 ("ACPI: utils: Fix reference counting in for_each_acpi_dev_match()")Depends-on:
fc68f42aa737("ACPI: fix NULL pointer dereference")Reported-by Jens Axboe <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- drivers/media/pci/intel/ipu3/cio2-bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/pci/intel/ipu3/cio2-bridge.c +0
-0
drivers/media/pci/intel/ipu3/cio2-bridge.c static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, · line 229
Quoted 5 lines
drivers/media/pci/intel/ipu3/cio2-bridge.c +1
-1@@ -226,7 +226,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, err_free_swnodes:software_node_unregister_nodes (sensor->swnodes); err_put_adev: -acpi_dev_put (sensor->adev); +acpi_dev_put (adev);
adev is assigned to sensor->adev before goto so the two have the same value. I have no problem with the patch though.
Quoted 3 lines
drivers/media/pci/intel/ipu3/cio2-bridge.c +0
-0return ret; }
Signature · 3 lines
Regards, Sakari Ailus
Quoted 1 line · Sakari Ailus
On Mon, Jul 26, 2021 at 11:40:55AM +0300, Andy Shevchenko wrote:
...
Quoted 8 lines
drivers/media/pci/intel/ipu3/cio2-bridge.c static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, · line 229
Quoted 5 lines
err_free_swnodes:software_node_unregister_nodes(sensor->swnodes);
err_put_adev:drivers/media/pci/intel/ipu3/cio2-bridge.c +1
-1-acpi_dev_put (sensor->adev); +acpi_dev_put (adev);adev is assigned to
sensor->adevbefore goto so the two have the same value. I have no problem with the patch though.
Are we reading the same version? Or am I missing something?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Sakari Ailus
maintainerQuoted 12 lines · Andy Shevchenko
Quoted 1 line · Sakari Ailus
On Mon, Jul 26, 2021 at 11:40:55AM +0300, Andy Shevchenko wrote:
...
Quoted 6 lines
Quoted 5 lines
err_free_swnodes:software_node_unregister_nodes(sensor->swnodes);
err_put_adev:drivers/media/pci/intel/ipu3/cio2-bridge.c +1
-1-acpi_dev_put (sensor->adev); +acpi_dev_put (adev);
Quoted 4 lines
Quoted 2 lines
adev is assigned to
sensor->adevbefore goto so the two have the same value. I have no problem with the patch though.Are we reading the same version? Or am I missing something?
I'm looking at the one in media-tree master.
Signature · 1 line
Sakari Ailus
Sakari Ailus
maintainerQuoted 12 lines · Andy Shevchenko
Quoted 1 line · Sakari Ailus
On Mon, Jul 26, 2021 at 11:40:55AM +0300, Andy Shevchenko wrote:
...
Quoted 6 lines
Quoted 5 lines
err_free_swnodes:software_node_unregister_nodes(sensor->swnodes);
err_put_adev:drivers/media/pci/intel/ipu3/cio2-bridge.c +1
-1-acpi_dev_put (sensor->adev); +acpi_dev_put (adev);
Quoted 4 lines
Quoted 2 lines
adev is assigned to
sensor->adevbefore goto so the two have the same value. I have no problem with the patch though.Are we reading the same version? Or am I missing something?
Ah. I noticed the adev assignment was removed (and added later) by the other patch. Yeah, agreed; this one's needed.
Signature · 1 line
Sakari Ailus
Quoted 13 lines · Sakari Ailus
Quoted 12 lines · Andy Shevchenko
Quoted 1 line · Sakari Ailus
On Mon, Jul 26, 2021 at 11:40:55AM +0300, Andy Shevchenko wrote:
...
Quoted 6 lines
Quoted 5 lines
err_free_swnodes:software_node_unregister_nodes(sensor->swnodes);
err_put_adev:drivers/media/pci/intel/ipu3/cio2-bridge.c +1
-1-acpi_dev_put (sensor->adev); +acpi_dev_put (adev);
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
adev is assigned to
sensor->adevbefore goto so the two have the same value. I have no problem with the patch though.Are we reading the same version? Or am I missing something?
I'm looking at the one in media-tree master.
Maintainers with a push access may FF merge the v5.14-rc3 as far as I can tell and then you will see the difference.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 13 lines · Sakari Ailus
Quoted 12 lines · Andy Shevchenko
Quoted 1 line · Sakari Ailus
On Mon, Jul 26, 2021 at 11:40:55AM +0300, Andy Shevchenko wrote:
...
Quoted 6 lines
Quoted 5 lines
err_free_swnodes:software_node_unregister_nodes(sensor->swnodes);
err_put_adev:drivers/media/pci/intel/ipu3/cio2-bridge.c +1
-1-acpi_dev_put (sensor->adev); +acpi_dev_put (adev);
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
adev is assigned to
sensor->adevbefore goto so the two have the same value. I have no problem with the patch though.Are we reading the same version? Or am I missing something?
Ah. I noticed the adev assignment was removed (and added later) by the other patch. Yeah, agreed; this one's needed.
Thanks! Can we have your tag?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 17 lines · Andy Shevchenko
Quoted 16 lines · Sakari Ailus
Quoted 15 lines · Andy Shevchenko
Quoted 1 line · Sakari Ailus
On Mon, Jul 26, 2021 at 11:40:55AM +0300, Andy Shevchenko wrote:
...
Quoted 8 lines
drivers/media/pci/intel/ipu3/cio2-bridge.c static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, · line 229
Quoted 5 lines
err_free_swnodes:software_node_unregister_nodes(sensor->swnodes);
err_put_adev:drivers/media/pci/intel/ipu3/cio2-bridge.c +1
-1-acpi_dev_put (sensor->adev); +acpi_dev_put (adev);adev is assigned to
sensor->adevbefore goto so the two have the same value. I have no problem with the patch though.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Are we reading the same version? Or am I missing something?
Ah. I noticed the adev assignment was removed (and added later) by the other patch. Yeah, agreed; this one's needed.
Thanks! Can we have your tag?
Apologies for the delay.
Signature · 1 line
Sakari Ailus