diff options
| author | Joe Lawrence <joe.lawrence@stratus.com> | 2016-05-25 15:14:28 -0400 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-07-12 23:16:31 -0400 |
| commit | 87aa95d4bb77613acaed9724efe07dde9e9bacd7 (patch) | |
| tree | 292745673bb9c5589b8c90678e105c592ef2d60c /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | ufs: Adding license info do tc-dwc-g210 and ufshcd-dwc to enable loadable module (diff) | |
| download | linux-87aa95d4bb77613acaed9724efe07dde9e9bacd7.tar.gz linux-87aa95d4bb77613acaed9724efe07dde9e9bacd7.zip | |
mpt3sas: set num_phys after allocating phy[] space
In _scsih_sas_host_add, the number of HBA phys are determined and then
later used to allocate an array of struct _sas_phy's. If the routine
sets ioc->sas_hba.num_phys, but then fails to allocate the
ioc->sas_hba.phy array (by kcalloc error or other intermediate
error/exit path), ioc->sas_hba is left in a dangerous state: all readers
of ioc->sas_hba.phy[] do so by indexing it from 0..ioc->sas_hba.num_phys
without checking that the space was ever allocated.
Modify _scsih_sas_host_add to set ioc->sas_hba.num_phys only after
successfully allocating ioc->sas_hba.phy[].
Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
