summaryrefslogtreecommitdiff
path: root/target/linux/mcs814x
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-08-08 21:51:04 +0000
committerFlorian Fainelli <florian@openwrt.org>2012-08-08 21:51:04 +0000
commitb77494fa2f64003979e144d00cee92b261b3f892 (patch)
tree689c0273af65aeb6a52df729796506cbb1dad006 /target/linux/mcs814x
parent798cc28d73ab9da2c22ddccc77269a9fc2c7acbe (diff)
downloadmtk-20170518-b77494fa2f64003979e144d00cee92b261b3f892.zip
mtk-20170518-b77494fa2f64003979e144d00cee92b261b3f892.tar.gz
mtk-20170518-b77494fa2f64003979e144d00cee92b261b3f892.tar.bz2
nuport-mac: check dma_map_single address return values
SVN-Revision: 33067
Diffstat (limited to 'target/linux/mcs814x')
-rw-r--r--target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c4
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 794987f..38dbe1e 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();