]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: ipu3-cio2: Drop reference on error path in cio2_bridge_connect_sensor()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 26 Aug 2021 10:53:24 +0000 (13:53 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 26 Aug 2021 16:52:30 +0000 (18:52 +0200)
The commit ba40affef143 ("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.

Fixes: ba40affef143 ("ACPI: utils: Fix reference counting in for_each_acpi_dev_match()")
Depends-on: 2174f188ea3e ("ACPI: fix NULL pointer dereference")
Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/media/pci/intel/ipu3/cio2-bridge.c

index 59a36f92267555175db081310b3a32c0b0052c6b..30d29b96a339643aa226d81228b38d956f6451b7 100644 (file)
@@ -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;
 }