All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: ipu-bridge: fix error code in ipu_bridge_init()
@ 2024-05-10 15:10 Dan Carpenter
  2024-05-10 15:18 ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2024-05-10 15:10 UTC (permalink / raw)
  To: Bingbu Cao
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Hans de Goede,
	Andy Shevchenko, Daniel Scally, linux-media, linux-kernel,
	kernel-janitors

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@linaro.org>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-10 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-10 15:10 [PATCH] media: ipu-bridge: fix error code in ipu_bridge_init() Dan Carpenter
2024-05-10 15:18 ` Andy Shevchenko
2024-05-10 15:27   ` Dan Carpenter
2024-05-10 15:36     ` Andy Shevchenko
2024-05-10 15:42       ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.