Commit 8947fd10 authored by Robert Elliott's avatar Robert Elliott Committed by James Bottomley

hpsa: avoid unneccesary calls to resource freeing functions

If hpsa_allocate_cmd_pool failed, we were calling two functions unnecessarily:

  hpsa_free_sg_chain_blocks(h);
  hpsa_free_cmd_pool(h);

This didn't cause any problem, as those functions can tolerate being called
when what they free hasn't been allocated (relevant pointers would be NULL)
but it is potentially confusing.
Reviewed-by: default avatarScott Teel <scott.teel@pmcs.com>
Signed-off-by: default avatarRobert Elliott <elliott@hp.com>
Signed-off-by: default avatarDon Brace <don.brace@pmcs.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 2c143342
...@@ -6948,8 +6948,9 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -6948,8 +6948,9 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev_info(&pdev->dev, "%s: <0x%x> at IRQ %d%s using DAC\n", dev_info(&pdev->dev, "%s: <0x%x> at IRQ %d%s using DAC\n",
h->devname, pdev->device, h->devname, pdev->device,
h->intr[h->intr_mode], dac ? "" : " not"); h->intr[h->intr_mode], dac ? "" : " not");
if (hpsa_allocate_cmd_pool(h)) rc = hpsa_allocate_cmd_pool(h);
goto clean4; if (rc)
goto clean2_and_free_irqs;
if (hpsa_allocate_sg_chain_blocks(h)) if (hpsa_allocate_sg_chain_blocks(h))
goto clean4; goto clean4;
init_waitqueue_head(&h->scan_wait_queue); init_waitqueue_head(&h->scan_wait_queue);
...@@ -7038,6 +7039,7 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7038,6 +7039,7 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
clean4: clean4:
hpsa_free_sg_chain_blocks(h); hpsa_free_sg_chain_blocks(h);
hpsa_free_cmd_pool(h); hpsa_free_cmd_pool(h);
clean2_and_free_irqs:
hpsa_free_irqs(h); hpsa_free_irqs(h);
clean2: clean2:
clean1: clean1:
......
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