|
@@ -1769,10 +1769,12 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,
|
|
sas_disable_routing(parent, phy->attached_sas_addr);
|
|
sas_disable_routing(parent, phy->attached_sas_addr);
|
|
}
|
|
}
|
|
memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
|
|
memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
|
|
- sas_port_delete_phy(phy->port, phy->phy);
|
|
|
|
- if (phy->port->num_phys == 0)
|
|
|
|
- sas_port_delete(phy->port);
|
|
|
|
- phy->port = NULL;
|
|
|
|
|
|
+ if (phy->port) {
|
|
|
|
+ sas_port_delete_phy(phy->port, phy->phy);
|
|
|
|
+ if (phy->port->num_phys == 0)
|
|
|
|
+ sas_port_delete(phy->port);
|
|
|
|
+ phy->port = NULL;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static int sas_discover_bfs_by_root_level(struct domain_device *root,
|
|
static int sas_discover_bfs_by_root_level(struct domain_device *root,
|