From: Dan Carpenter <dan.carpenter@linaro.org>
To: Bingbu Cao <bingbu.cao@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans de Goede <hdegoede@redhat.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Daniel Scally <dan.scally@ideasonboard.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH v2] media: ipu-bridge: fix error code in ipu_bridge_init()
Date: Fri, 10 May 2024 18:43:31 +0300 [thread overview]
Message-ID: <f468c4ac-0629-41b5-b5d1-e26f70e44800@moroto.mountain> (raw)
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>
---
v2: style change
drivers/media/pci/intel/ipu-bridge.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
index 61750cc98d70..44a9d9c15b05 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -839,9 +839,14 @@ 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)
goto err_unregister_ipu;
+ if (bridge->n_sensors == 0) {
+ ret = -EINVAL;
+ goto err_unregister_ipu;
+ }
+
dev_info(dev, "Connected %d cameras\n", bridge->n_sensors);
fwnode = software_node_fwnode(&bridge->ipu_hid_node);
--
2.43.0
next reply other threads:[~2024-05-10 15:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-10 15:43 Dan Carpenter [this message]
2024-05-10 15:55 ` Andy Shevchenko
2024-05-14 10:14 ` Dan Scally
2024-05-14 14:06 ` Dan Carpenter
2024-05-14 14:33 ` Sakari Ailus
2024-05-14 15:21 ` Andy Shevchenko
2024-05-14 15:38 ` Hans de Goede
2024-05-22 12:03 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f468c4ac-0629-41b5-b5d1-e26f70e44800@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bingbu.cao@intel.com \
--cc=dan.scally@ideasonboard.com \
--cc=hdegoede@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®