aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames.Smart@Emulex.Com <James.Smart@Emulex.Com>2005-08-10 15:03:01 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-08-12 13:08:48 -0400
commitf888ba3ce77c66bece3d804caf7d559838209a4a (patch)
tree7bdd2439b758199b84eee084f6e5b184dfc28b75 /drivers/scsi/lpfc/lpfc_init.c
parent69859dc47744430ecda16522b0791b6d17e3fa93 (diff)
[SCSI] lpfc driver 8.0.30 : fix get_stats panic
Fix panic in lpfc_get_stats() Symptoms: Panic on sysfs stats access Cause: In lpfc_get_stats() we are writing to memory that we do not own. Fix: Fix our stats structure allocation. Embed phba->link_stats in struct lpfc_hba and stop treating it like rogue structure. Note: Embedding midlayer/transport structure in our structure caused need for more files to include midlayer/transport headers. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 34d416d2b007..1b6d1dcdabb3 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1339,14 +1339,12 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1339 if (pci_request_regions(pdev, LPFC_DRIVER_NAME)) 1339 if (pci_request_regions(pdev, LPFC_DRIVER_NAME))
1340 goto out_disable_device; 1340 goto out_disable_device;
1341 1341
1342 host = scsi_host_alloc(&lpfc_template, 1342 host = scsi_host_alloc(&lpfc_template, sizeof (struct lpfc_hba));
1343 sizeof (struct lpfc_hba) + sizeof (unsigned long));
1344 if (!host) 1343 if (!host)
1345 goto out_release_regions; 1344 goto out_release_regions;
1346 1345
1347 phba = (struct lpfc_hba*)host->hostdata; 1346 phba = (struct lpfc_hba*)host->hostdata;
1348 memset(phba, 0, sizeof (struct lpfc_hba)); 1347 memset(phba, 0, sizeof (struct lpfc_hba));
1349 phba->link_stats = (void *)&phba[1];
1350 phba->host = host; 1348 phba->host = host;
1351 1349
1352 phba->fc_flag |= FC_LOADING; 1350 phba->fc_flag |= FC_LOADING;