diff options
author | Florian Fainelli <florian@openwrt.org> | 2012-08-08 21:51:04 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2012-08-08 21:51:04 +0000 |
commit | c44746912461f7464f7f8252a1daae0c791d3a5c (patch) | |
tree | e447ab95c79736ca992d47a20e1b661685f1ab4c /target | |
parent | bd676f181af25efb5f5568480d25fa7a0ee3999e (diff) | |
download | upstream-c44746912461f7464f7f8252a1daae0c791d3a5c.tar.gz upstream-c44746912461f7464f7f8252a1daae0c791d3a5c.tar.bz2 upstream-c44746912461f7464f7f8252a1daae0c791d3a5c.zip |
[mcs814x] nuport-mac: check dma_map_single address return values
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33067 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c index 794987f73b..38dbe1ee7d 100644 --- a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c +++ b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c @@ -256,6 +256,8 @@ static int nuport_mac_start_tx_dma(struct nuport_mac_priv *priv, priv->tx_addr = dma_map_single(&priv->pdev->dev, skb->data, skb->len, DMA_TO_DEVICE); + if (!priv->tx_addr) + return -ENOMEM; /* enable enhanced mode */ nuport_mac_writel(TX_DMA_ENH_ENABLE, TX_DMA_ENH); @@ -297,6 +299,8 @@ static int nuport_mac_start_rx_dma(struct nuport_mac_priv *priv, priv->rx_addr = dma_map_single(&priv->pdev->dev, skb->data, RX_ALLOC_SIZE, DMA_FROM_DEVICE); + if (!priv->rx_addr) + return -ENOMEM; nuport_mac_writel(priv->rx_addr, RX_BUFFER_ADDR); wmb(); |