summaryrefslogtreecommitdiff
path: root/drivers/ntb/ntb_transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ntb/ntb_transport.c')
-rw-r--r--drivers/ntb/ntb_transport.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 250190fba757..1d17857a2d97 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -288,6 +288,9 @@ int ntb_register_client_dev(char *device_name)
struct ntb_transport *nt;
int rc;
+ if (list_empty(&ntb_transport_list))
+ return -ENODEV;
+
list_for_each_entry(nt, &ntb_transport_list, entry) {
struct device *dev;
@@ -336,6 +339,9 @@ int ntb_register_client(struct ntb_client *drv)
{
drv->driver.bus = &ntb_bus_type;
+ if (list_empty(&ntb_transport_list))
+ return -ENODEV;
+
return driver_register(&drv->driver);
}
EXPORT_SYMBOL_GPL(ntb_register_client);