IB/qib: clean up properly if pci_set_consistent_dma_mask() fails
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tue, 26 Oct 2010 04:19:06 +0000 (21:19 -0700)
committerRoland Dreier <rolandd@cisco.com>
Tue, 26 Oct 2010 23:09:02 +0000 (16:09 -0700)
Clean up properly if pci_set_consistent_dma_mask() fails.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/qib/qib_pcie.c

index 8a644266f4aa88c8705bfca764610fb2d6202507..48b6674cbc49f97b9fd4e8d225325b6304833b5d 100644 (file)
@@ -103,9 +103,11 @@ int qib_pcie_init(struct pci_dev *pdev, const struct pci_device_id *ent)
                ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
        } else
                ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
-       if (ret)
+       if (ret) {
                qib_early_err(&pdev->dev,
                              "Unable to set DMA consistent mask: %d\n", ret);
+               goto bail;
+       }
 
        pci_set_master(pdev);
        ret = pci_enable_pcie_error_reporting(pdev);