Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117888
b: refs/heads/master
c: 7007a07
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Oct 26, 2008
1 parent 4c4054b commit 80a79a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a55709ba9d27053471f9fca8ee76b41ecefc14cd
refs/heads/master: 7007a0765e33bf89182e069e35ec6009fa54f610
23 changes: 14 additions & 9 deletions trunk/drivers/firewire/fw-ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2365,8 +2365,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)

ohci = kzalloc(sizeof(*ohci), GFP_KERNEL);
if (ohci == NULL) {
fw_error("Could not malloc fw_ohci data.\n");
return -ENOMEM;
err = -ENOMEM;
goto fail;
}

fw_card_initialize(&ohci->card, &ohci_driver, &dev->dev);
Expand All @@ -2375,7 +2375,7 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)

err = pci_enable_device(dev);
if (err) {
fw_error("Failed to enable OHCI hardware.\n");
fw_error("Failed to enable OHCI hardware\n");
goto fail_free;
}

Expand Down Expand Up @@ -2443,9 +2443,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
ohci->ir_context_list = kzalloc(size, GFP_KERNEL);

if (ohci->it_context_list == NULL || ohci->ir_context_list == NULL) {
fw_error("Out of memory for it/ir contexts.\n");
err = -ENOMEM;
goto fail_registers;
goto fail_contexts;
}

/* self-id dma buffer allocation */
Expand All @@ -2454,9 +2453,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
&ohci->self_id_bus,
GFP_KERNEL);
if (ohci->self_id_cpu == NULL) {
fw_error("Out of memory for self ID buffer.\n");
err = -ENOMEM;
goto fail_registers;
goto fail_contexts;
}

bus_options = reg_read(ohci, OHCI1394_BusOptions);
Expand All @@ -2476,9 +2474,13 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
fail_self_id:
dma_free_coherent(ohci->card.device, SELF_ID_BUF_SIZE,
ohci->self_id_cpu, ohci->self_id_bus);
fail_registers:
kfree(ohci->it_context_list);
fail_contexts:
kfree(ohci->ir_context_list);
kfree(ohci->it_context_list);
context_release(&ohci->at_response_ctx);
context_release(&ohci->at_request_ctx);
ar_context_release(&ohci->ar_response_ctx);
ar_context_release(&ohci->ar_request_ctx);
pci_iounmap(dev, ohci->registers);
fail_iomem:
pci_release_region(dev, 0);
Expand All @@ -2487,6 +2489,9 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
fail_free:
kfree(&ohci->card);
ohci_pmac_off(dev);
fail:
if (err == -ENOMEM)
fw_error("Out of memory\n");

return err;
}
Expand Down

0 comments on commit 80a79a4

Please sign in to comment.