Commit b2ef480c authored by Robert Elliott's avatar Robert Elliott Committed by James Bottomley

hpsa: fix try_soft_reset error handling

If registering the special interrupt handlers in hpsa_init_one
before a soft reset fails, the error exit needs to deallocate
everything that was allocated before.
Reviewed-by: default avatarScott Teel <scott.teel@pmcs.com>
Reviewed-by: default avatarKevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Reviewed-by: default avatarHannes Reinecke <hare@Suse.de>
Signed-off-by: default avatarRobert Elliott <elliott@hp.com>
Signed-off-by: default avatarDon Brace <don.brace@pmcs.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 9ecd953a
...@@ -7770,9 +7770,15 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7770,9 +7770,15 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev_warn(&h->pdev->dev, dev_warn(&h->pdev->dev,
"Failed to request_irq after soft reset.\n"); "Failed to request_irq after soft reset.\n");
/* /*
* clean4 starts with free_irqs, but that was just * cannot goto clean7 or free_irqs will be called
* done. Then, request_irqs_failed, so there is * again. Instead, do its work
* nothing to free. So, goto the next label. */
hpsa_free_performant_mode(h); /* clean7 */
hpsa_free_sg_chain_blocks(h); /* clean6 */
hpsa_free_cmd_pool(h); /* clean5 */
/*
* skip hpsa_free_irqs(h) clean4 since that
* was just called before request_irqs failed
*/ */
goto clean3; goto clean3;
} }
...@@ -7780,7 +7786,7 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7780,7 +7786,7 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
rc = hpsa_kdump_soft_reset(h); rc = hpsa_kdump_soft_reset(h);
if (rc) if (rc)
/* Neither hard nor soft reset worked, we're hosed. */ /* Neither hard nor soft reset worked, we're hosed. */
goto clean4; goto clean7;
dev_info(&h->pdev->dev, "Board READY.\n"); dev_info(&h->pdev->dev, "Board READY.\n");
dev_info(&h->pdev->dev, dev_info(&h->pdev->dev,
...@@ -7801,7 +7807,7 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7801,7 +7807,7 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
hpsa_undo_allocations_after_kdump_soft_reset(h); hpsa_undo_allocations_after_kdump_soft_reset(h);
try_soft_reset = 0; try_soft_reset = 0;
if (rc) if (rc)
/* don't go to clean4, we already unallocated */ /* don't goto clean, we already unallocated */
return -ENODEV; return -ENODEV;
goto reinit_after_soft_reset; goto reinit_after_soft_reset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment