diff options
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 608e8ce6cc74..a68798350ec8 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -4796,7 +4796,7 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc, | |||
4796 | int i; | 4796 | int i; |
4797 | u16 parent_handle, handle; | 4797 | u16 parent_handle, handle; |
4798 | u16 reason_code; | 4798 | u16 reason_code; |
4799 | u8 phy_number; | 4799 | u8 phy_number, max_phys; |
4800 | struct _sas_node *sas_expander; | 4800 | struct _sas_node *sas_expander; |
4801 | struct _sas_device *sas_device; | 4801 | struct _sas_device *sas_device; |
4802 | u64 sas_address; | 4802 | u64 sas_address; |
@@ -4834,11 +4834,13 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc, | |||
4834 | sas_expander = mpt2sas_scsih_expander_find_by_handle(ioc, | 4834 | sas_expander = mpt2sas_scsih_expander_find_by_handle(ioc, |
4835 | parent_handle); | 4835 | parent_handle); |
4836 | spin_unlock_irqrestore(&ioc->sas_node_lock, flags); | 4836 | spin_unlock_irqrestore(&ioc->sas_node_lock, flags); |
4837 | if (sas_expander) | 4837 | if (sas_expander) { |
4838 | sas_address = sas_expander->sas_address; | 4838 | sas_address = sas_expander->sas_address; |
4839 | else if (parent_handle < ioc->sas_hba.num_phys) | 4839 | max_phys = sas_expander->num_phys; |
4840 | } else if (parent_handle < ioc->sas_hba.num_phys) { | ||
4840 | sas_address = ioc->sas_hba.sas_address; | 4841 | sas_address = ioc->sas_hba.sas_address; |
4841 | else | 4842 | max_phys = ioc->sas_hba.num_phys; |
4843 | } else | ||
4842 | return; | 4844 | return; |
4843 | 4845 | ||
4844 | /* handle siblings events */ | 4846 | /* handle siblings events */ |
@@ -4852,6 +4854,8 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc, | |||
4852 | ioc->pci_error_recovery) | 4854 | ioc->pci_error_recovery) |
4853 | return; | 4855 | return; |
4854 | phy_number = event_data->StartPhyNum + i; | 4856 | phy_number = event_data->StartPhyNum + i; |
4857 | if (phy_number >= max_phys) | ||
4858 | continue; | ||
4855 | reason_code = event_data->PHY[i].PhyStatus & | 4859 | reason_code = event_data->PHY[i].PhyStatus & |
4856 | MPI2_EVENT_SAS_TOPO_RC_MASK; | 4860 | MPI2_EVENT_SAS_TOPO_RC_MASK; |
4857 | if ((event_data->PHY[i].PhyStatus & | 4861 | if ((event_data->PHY[i].PhyStatus & |