Skip to content

Commit

Permalink
be2net: Fix 32-bit DMA Mask handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Somnath Kotur authored and David S. Miller committed Jun 13, 2013
1 parent e86c986 commit 0c5fed0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0c5fed0

Please sign in to comment.