Skip to content

Commit

Permalink
media: ipu3-cio2: Drop reference on error path in cio2_bridge_connect…
Browse files Browse the repository at this point in the history
…_sensor()

The commit 71f6428 ("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: 71f6428 ("ACPI: utils: Fix reference counting in for_each_acpi_dev_match()")
Depends-on: fc68f42 ("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>
  • Loading branch information
andy-shev authored and rafaeljw committed Aug 26, 2021
1 parent e22ce8e commit 294c34e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/pci/intel/ipu3/cio2-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 294c34e

Please sign in to comment.