media: ipu3-cio2: fix error code in cio2_bridge_connect_sensor()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Oct 2021 07:53:19 +0000 (08:53 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 15 Nov 2021 08:11:34 +0000 (08:11 +0000)
Return -ENODEV if acpi_get_physical_device_location() fails.  Don't
return success.

Fixes: 485aa3df0dff ("media: ipu3-cio2: Parse sensor orientation and rotation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.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

index 67c467d3c81f94b6b4c4a17d5d51d579a8f74329..0b586b4e537ef8ceccdecef63b2155cdfb7f9091 100644 (file)
@@ -238,8 +238,10 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
                        goto err_put_adev;
 
                status = acpi_get_physical_device_location(adev->handle, &sensor->pld);
-               if (ACPI_FAILURE(status))
+               if (ACPI_FAILURE(status)) {
+                       ret = -ENODEV;
                        goto err_put_adev;
+               }
 
                if (sensor->ssdb.lanes > CIO2_MAX_LANES) {
                        dev_err(&adev->dev,