Skip to contentSkip to conversation

media: ipu3-cio2: fix error code in cio2_bridge_connect_sensor()

PATCH In review Dan Carpenter 3 participants 3 messages Oct 13, 2021 – Oct 14, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: ipu3-cio2: fix error code in cio2_bridge_connect_sensor()

Return -ENODEV if acpi_get_physical_device_location() fails. Don't return success.

Fixes 485aa3df0dff ("media: ipu3-cio2: Parse sensor orientation and rotation")
---
 drivers/media/pci/intel/ipu3/cio2-bridge.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/pci/intel/ipu3/cio2-bridge.c +3 -1
index 67c467d3c81f..0b586b4e537e 100644
@@ -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,
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Dan

Quoted 5 lines · Dan Carpenter

Return -ENODEV if acpi_get_physical_device_location() fails. Don't return success.

Fixes 485aa3df0dff ("media: ipu3-cio2: Parse sensor orientation and rotation")

Thanks for catching that.

Quoted 20 lines
---
 drivers/media/pci/intel/ipu3/cio2-bridge.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/pci/intel/ipu3/cio2-bridge.c +3 -1
index 67c467d3c81f..0b586b4e537e 100644
@@ -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,
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter

Quoting Dan Carpenter (2021-10-13 08:53:19)

Quoted 5 lines

Return -ENODEV if acpi_get_physical_device_location() fails. Don't return success.

Fixes 485aa3df0dff ("media: ipu3-cio2: Parse sensor orientation and rotation")
Quoted 23 lines
---
 drivers/media/pci/intel/ipu3/cio2-bridge.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/pci/intel/ipu3/cio2-bridge.c +3 -1
index 67c467d3c81f..0b586b4e537e 100644
@@ -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,
Signature · 1 line
2.20.1