projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f82ef3e
)
net: macb: add check for dma mapping error in start_xmit()
author
Alexey Khoroshilov
<
[email protected]
>
Fri, 18 Nov 2016 22:40:10 +0000
(
01:40
+0300)
committer
David S. Miller
<
[email protected]
>
Sat, 19 Nov 2016 15:29:49 +0000
(10:29 -0500)
at91ether_start_xmit() does not check for dma mapping errors.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/cadence/macb.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/cadence/macb.c
b/drivers/net/ethernet/cadence/macb.c
index b32444a3ed79d311fc4047aa10eabc5f630b66cb..533653bd7aec99781af410a6c10be47d2ffc6fc0 100644
(file)
--- a/
drivers/net/ethernet/cadence/macb.c
+++ b/
drivers/net/ethernet/cadence/macb.c
@@
-2673,6
+2673,12
@@
static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
lp->skb_length = skb->len;
lp->skb_physaddr = dma_map_single(NULL, skb->data, skb->len,
DMA_TO_DEVICE);
+ if (dma_mapping_error(NULL, lp->skb_physaddr)) {
+ dev_kfree_skb_any(skb);
+ dev->stats.tx_dropped++;
+ netdev_err(dev, "%s: DMA mapping error\n", __func__);
+ return NETDEV_TX_OK;
+ }
/* Set address of the data in the Transmit Address register */
macb_writel(lp, TAR, lp->skb_physaddr);