be2net: Fix 32-bit DMA Mask handling
authorSomnath Kotur <somnath.kotur@emulex.com>
Tue, 11 Jun 2013 11:48:22 +0000 (17:18 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Jun 2013 08:28:36 +0000 (01:28 -0700)
Fix to set the coherent DMA mask only if dma_set_mask() succeeded, and to
error out if either fails.

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 8bc1b21b1c790b44cffc347d7fe365f22f3a7ee2..a0b4be51f0d1d09781a216d0ffe13ecc57805129 100644 (file)
@@ -4262,6 +4262,9 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
                netdev->features |= NETIF_F_HIGHDMA;
        } else {
                status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+               if (!status)
+                       status = dma_set_coherent_mask(&pdev->dev,
+                                                      DMA_BIT_MASK(32));
                if (status) {
                        dev_err(&pdev->dev, "Could not set PCI DMA Mask\n");
                        goto free_netdev;