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:
db4e9b2
)
net: eth: davicnci_cpdma: check dma map error
author
Sebastian Siewior
<
[email protected]
>
Thu, 20 Jun 2013 14:58:45 +0000
(16:58 +0200)
committer
David S. Miller
<
[email protected]
>
Mon, 24 Jun 2013 07:07:30 +0000
(
00:07
-0700)
Since the DMA mapping may fail the caller should check the return value.
Cc: Mugunthan V N <
[email protected]
>
Signed-off-by: Sebastian Andrzej Siewior <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/ti/davinci_cpdma.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/ti/davinci_cpdma.c
b/drivers/net/ethernet/ti/davinci_cpdma.c
index 49dfd592ac1ecd4e0a86d8d5ad01572a97e5c346..053c84fd085313d4bd6487a62a33f17e812cc28b 100644
(file)
--- a/
drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/
drivers/net/ethernet/ti/davinci_cpdma.c
@@
-705,6
+705,13
@@
int cpdma_chan_submit(struct cpdma_chan *chan, void *token, void *data,
}
buffer = dma_map_single(ctlr->dev, data, len, chan->dir);
+ ret = dma_mapping_error(ctlr->dev, buffer);
+ if (ret) {
+ cpdma_desc_free(ctlr->pool, desc, 1);
+ ret = -EINVAL;
+ goto unlock_ret;
+ }
+
mode = CPDMA_DESC_OWNER | CPDMA_DESC_SOP | CPDMA_DESC_EOP;
cpdma_desc_to_port(chan, mode, directed);