Return -EINVAL if "bridge->n_sensors == 0". Don't return success. Fixes: 881ca25978c6 ("media: ipu3-cio2: rename cio2 bridge to ipu bridge and move out of ipu3") Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> --- drivers/media/pci/intel/ipu-bridge.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index 61750cc98d70..a009ee73e26f 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -839,8 +839,10 @@ int ipu_bridge_init(struct device *dev, bridge->data_lanes[i] = i + 1; ret = ipu_bridge_connect_sensors(bridge); - if (ret || bridge->n_sensors == 0) + if (ret || bridge->n_sensors == 0) { + ret = ret ?: -EINVAL; goto err_unregister_ipu; + } dev_info(dev, "Connected %d cameras\n", bridge->n_sensors); -- 2.43.0