diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-18 11:28:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-18 11:28:08 -0400 |
commit | 5aa43efe905bdf3f1bd3cfddf035f7ebee2590eb (patch) | |
tree | fec073032dbe8968d238d38b79368947bb98c6d8 | |
parent | 37c1e28931333c4b838d1c8db5cdd8d75165dc6b (diff) | |
parent | 6449e31ddebdce68508cfaf0915d31aad3835f4f (diff) |
Merge tag 'firewire-update' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
Pull firewire fixlet from Stefan Richter:
"IEEE 1394 subsystem patch: catch an initialization error in the packet
sniffer nosy"
* tag 'firewire-update' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
firewire: nosy: do not ignore errors in ioremap_nocache()
-rw-r--r-- | drivers/firewire/nosy.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c index 631c977b0da5..180f0a96528c 100644 --- a/drivers/firewire/nosy.c +++ b/drivers/firewire/nosy.c | |||
@@ -566,6 +566,11 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused) | |||
566 | 566 | ||
567 | lynx->registers = ioremap_nocache(pci_resource_start(dev, 0), | 567 | lynx->registers = ioremap_nocache(pci_resource_start(dev, 0), |
568 | PCILYNX_MAX_REGISTER); | 568 | PCILYNX_MAX_REGISTER); |
569 | if (lynx->registers == NULL) { | ||
570 | dev_err(&dev->dev, "Failed to map registers\n"); | ||
571 | ret = -ENOMEM; | ||
572 | goto fail_deallocate_lynx; | ||
573 | } | ||
569 | 574 | ||
570 | lynx->rcv_start_pcl = pci_alloc_consistent(lynx->pci_device, | 575 | lynx->rcv_start_pcl = pci_alloc_consistent(lynx->pci_device, |
571 | sizeof(struct pcl), &lynx->rcv_start_pcl_bus); | 576 | sizeof(struct pcl), &lynx->rcv_start_pcl_bus); |
@@ -578,7 +583,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused) | |||
578 | lynx->rcv_buffer == NULL) { | 583 | lynx->rcv_buffer == NULL) { |
579 | dev_err(&dev->dev, "Failed to allocate receive buffer\n"); | 584 | dev_err(&dev->dev, "Failed to allocate receive buffer\n"); |
580 | ret = -ENOMEM; | 585 | ret = -ENOMEM; |
581 | goto fail_deallocate; | 586 | goto fail_deallocate_buffers; |
582 | } | 587 | } |
583 | lynx->rcv_start_pcl->next = cpu_to_le32(lynx->rcv_pcl_bus); | 588 | lynx->rcv_start_pcl->next = cpu_to_le32(lynx->rcv_pcl_bus); |
584 | lynx->rcv_pcl->next = cpu_to_le32(PCL_NEXT_INVALID); | 589 | lynx->rcv_pcl->next = cpu_to_le32(PCL_NEXT_INVALID); |
@@ -641,7 +646,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused) | |||
641 | dev_err(&dev->dev, | 646 | dev_err(&dev->dev, |
642 | "Failed to allocate shared interrupt %d\n", dev->irq); | 647 | "Failed to allocate shared interrupt %d\n", dev->irq); |
643 | ret = -EIO; | 648 | ret = -EIO; |
644 | goto fail_deallocate; | 649 | goto fail_deallocate_buffers; |
645 | } | 650 | } |
646 | 651 | ||
647 | lynx->misc.parent = &dev->dev; | 652 | lynx->misc.parent = &dev->dev; |
@@ -668,7 +673,7 @@ fail_free_irq: | |||
668 | reg_write(lynx, PCI_INT_ENABLE, 0); | 673 | reg_write(lynx, PCI_INT_ENABLE, 0); |
669 | free_irq(lynx->pci_device->irq, lynx); | 674 | free_irq(lynx->pci_device->irq, lynx); |
670 | 675 | ||
671 | fail_deallocate: | 676 | fail_deallocate_buffers: |
672 | if (lynx->rcv_start_pcl) | 677 | if (lynx->rcv_start_pcl) |
673 | pci_free_consistent(lynx->pci_device, sizeof(struct pcl), | 678 | pci_free_consistent(lynx->pci_device, sizeof(struct pcl), |
674 | lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus); | 679 | lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus); |
@@ -679,6 +684,8 @@ fail_deallocate: | |||
679 | pci_free_consistent(lynx->pci_device, PAGE_SIZE, | 684 | pci_free_consistent(lynx->pci_device, PAGE_SIZE, |
680 | lynx->rcv_buffer, lynx->rcv_buffer_bus); | 685 | lynx->rcv_buffer, lynx->rcv_buffer_bus); |
681 | iounmap(lynx->registers); | 686 | iounmap(lynx->registers); |
687 | |||
688 | fail_deallocate_lynx: | ||
682 | kfree(lynx); | 689 | kfree(lynx); |
683 | 690 | ||
684 | fail_disable: | 691 | fail_disable: |