Commit 8222b402 authored by Jon Mason's avatar Jon Mason Committed by Greg Kroah-Hartman

NTB: Handle ntb client device probes without present hardware

Attempts to probe client ntb drivers without ntb hardware present will
result in null pointer dereference due to the lack of the ntb bus device
being registers.  Check to see if this is the case, and fail all calls
by the clients registering their drivers.
Signed-off-by: default avatarJon Mason <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 2910fe2a
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment