|
@@ -1701,6 +1701,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
|
|
if (error)
|
|
if (error)
|
|
goto out_free_consistent;
|
|
goto out_free_consistent;
|
|
|
|
|
|
|
|
+ if (!buffer->NumPhys) {
|
|
|
|
+ error = -ENODEV;
|
|
|
|
+ goto out_free_consistent;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* save config data */
|
|
/* save config data */
|
|
port_info->num_phys = buffer->NumPhys;
|
|
port_info->num_phys = buffer->NumPhys;
|
|
port_info->phy_info = kcalloc(port_info->num_phys,
|
|
port_info->phy_info = kcalloc(port_info->num_phys,
|