Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14bd0769 authored by Sebastian Siewior's avatar Sebastian Siewior Committed by David S. Miller
Browse files

net: eth: davicnci_cpdma: check dma map error



Since the DMA mapping may fail the caller should check the return value.

Cc: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db4e9b2b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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);