media: ipu3-cio2: Fix reference counting when looping over ACPI devices
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Sun, 4 Apr 2021 18:14:09 +0000 (20:14 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 2 Jun 2021 09:52:00 +0000 (11:52 +0200)
commit2cb2705cf7ffe41dc5bd81290e4241bfb7f031cc
treee9852d28e4a575769a78ea34a0cb391d733a449f
parent0e3e0c9369c822b7f1dd11504eeb98cfd4aabf24
media: ipu3-cio2: Fix reference counting when looping over ACPI devices

When we continue, due to device is disabled, loop we have to drop
reference count. When we have an array full of devices we have to also
drop the reference count. Note, in this case the
cio2_bridge_unregister_sensors() is called by the caller.

Fixes: 803abec64ef9 ("media: ipu3-cio2: Add cio2-bridge to ipu3-cio2 driver")
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Daniel Scally <djrscally@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/pci/intel/ipu3/cio2-bridge.c