From 97ee20886cfd257a7818087c1638ca60b9ffd192 Mon Sep 17 00:00:00 2001 From: jack_wang Date: Thu, 5 Nov 2009 22:33:51 +0800 Subject: [SCSI] pm8001: Fixes for tag alloc, error goto and code cleanup Allocate right size for bitmap tag,fix error goto and cleanup print message and undocable commemts. patch attached. Signed-off-by: Lindar Liu Signed-off-by: Jack Wang Signed-off-by: James Bottomley --- drivers/scsi/pm8001/pm8001_init.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/scsi/pm8001/pm8001_init.c') diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 811b5d36d5f0..42ebe725d5a5 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -203,9 +203,9 @@ static int __devinit pm8001_alloc(struct pm8001_hba_info *pm8001_ha) for (i = 0; i < pm8001_ha->chip->n_phy; i++) pm8001_phy_init(pm8001_ha, i); - pm8001_ha->tags = kmalloc(sizeof(*pm8001_ha->tags)*PM8001_MAX_DEVICES, - GFP_KERNEL); - + pm8001_ha->tags = kzalloc(PM8001_MAX_CCB, GFP_KERNEL); + if (!pm8001_ha->tags) + goto err_out; /* MPI Memory region 1 for AAP Event Log for fw */ pm8001_ha->memoryMap.region[AAP1].num_elements = 1; pm8001_ha->memoryMap.region[AAP1].element_size = PM8001_EVENT_LOG_SIZE; @@ -287,6 +287,9 @@ static int __devinit pm8001_alloc(struct pm8001_hba_info *pm8001_ha) pm8001_ha->ccb_info[i].ccb_dma_handle = pm8001_ha->memoryMap.region[CCB_MEM].phys_addr + i * sizeof(struct pm8001_ccb_info); + pm8001_ha->ccb_info[i].task = NULL; + pm8001_ha->ccb_info[i].ccb_tag = 0xffffffff; + pm8001_ha->ccb_info[i].device = NULL; ++pm8001_ha->tags_num; } pm8001_ha->flags = PM8001F_INIT_TIME; @@ -578,7 +581,7 @@ static u32 pm8001_request_irq(struct pm8001_hba_info *pm8001_ha) { struct pci_dev *pdev; irq_handler_t irq_handler = pm8001_interrupt; - u32 rc; + int rc; pdev = pm8001_ha->pdev; -- cgit v1.2.3