Skip to content

Commit 1d4c258

Browse files
geertuHans Verkuil
authored andcommitted
media: ipu-bridge: Add missing acpi_dev_put() in ipu_bridge_get_ivsc_acpi_dev()
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: c66821f ("media: pci: intel: Add IVSC support for IPU bridge driver") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent 30c1886 commit 1d4c258

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/media/pci/intel/ipu-bridge.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev
107107
for_each_acpi_dev_match(ivsc_adev, acpi_id->id, NULL, -1)
108108
/* camera sensor depends on IVSC in DSDT if exist */
109109
for_each_acpi_consumer_dev(ivsc_adev, consumer)
110-
if (consumer->handle == handle)
110+
if (consumer->handle == handle) {
111+
acpi_dev_put(consumer);
111112
return ivsc_adev;
113+
}
112114
}
113115

114116
return NULL;

0 commit comments

Comments
 (0)