[git:media_stage/fixes] media: ipu-bridge: Add missing acpi_dev_put() in ipu_bridge_get_ivsc_acpi_dev()

2023-10-13 Thread Hans Verkuil
This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: ipu-bridge: Add missing acpi_dev_put() in 
ipu_bridge_get_ivsc_acpi_dev()
Author:  Geert Uytterhoeven 
Date:Fri Sep 29 11:31:33 2023 +0200

In ipu_bridge_get_ivsc_acpi_dev(), the "ivsc_adev" acpi_device pointer
from the outer loop is handed over to the caller, which takes proper
care of its reference count.
However, the "consumer" acpi_device pointer from the inner loop is lost,
without decrementing its reference count.

Fix this by adding the missing call to acpi_dev_put().

Fixes: c66821f381ae ("media: pci: intel: Add IVSC support for IPU bridge 
driver")
Signed-off-by: Geert Uytterhoeven 
Reviewed-by: Andy Shevchenko 
Signed-off-by: Sakari Ailus 
Signed-off-by: Mauro Carvalho Chehab 
Signed-off-by: Hans Verkuil 

 drivers/media/pci/intel/ipu-bridge.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/pci/intel/ipu-bridge.c 
b/drivers/media/pci/intel/ipu-bridge.c
index 1bde8b6e0b11..e38198e259c0 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -107,8 +107,10 @@ static struct acpi_device 
*ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev
for_each_acpi_dev_match(ivsc_adev, acpi_id->id, NULL, -1)
/* camera sensor depends on IVSC in DSDT if exist */
for_each_acpi_consumer_dev(ivsc_adev, consumer)
-   if (consumer->handle == handle)
+   if (consumer->handle == handle) {
+   acpi_dev_put(consumer);
return ivsc_adev;
+   }
}
 
return NULL;

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[git:media_stage/fixes] media: ipu-bridge: Add missing acpi_dev_put() in ipu_bridge_get_ivsc_acpi_dev()

2023-10-11 Thread Hans Verkuil
This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: ipu-bridge: Add missing acpi_dev_put() in 
ipu_bridge_get_ivsc_acpi_dev()
Author:  Geert Uytterhoeven 
Date:Fri Sep 29 11:31:33 2023 +0200

In ipu_bridge_get_ivsc_acpi_dev(), the "ivsc_adev" acpi_device pointer
from the outer loop is handed over to the caller, which takes proper
care of its reference count.
However, the "consumer" acpi_device pointer from the inner loop is lost,
without decrementing its reference count.

Fix this by adding the missing call to acpi_dev_put().

Fixes: c66821f381ae ("media: pci: intel: Add IVSC support for IPU bridge 
driver")
Signed-off-by: Geert Uytterhoeven 
Reviewed-by: Andy Shevchenko 
Signed-off-by: Sakari Ailus 
Signed-off-by: Hans Verkuil 

 drivers/media/pci/intel/ipu-bridge.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/pci/intel/ipu-bridge.c 
b/drivers/media/pci/intel/ipu-bridge.c
index 1bde8b6e0b11..e38198e259c0 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -107,8 +107,10 @@ static struct acpi_device 
*ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev
for_each_acpi_dev_match(ivsc_adev, acpi_id->id, NULL, -1)
/* camera sensor depends on IVSC in DSDT if exist */
for_each_acpi_consumer_dev(ivsc_adev, consumer)
-   if (consumer->handle == handle)
+   if (consumer->handle == handle) {
+   acpi_dev_put(consumer);
return ivsc_adev;
+   }
}
 
return NULL;

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits