mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
mailbox: bcm-ferxrm-mailbox: Fix error check for dma_map_sg
[ Upstream commit6b207ce8a9
] dma_map_sg return 0 on error, fix the error check, and return -EIO to caller. Fixes:dbc049eee7
("mailbox: Add driver for Broadcom FlexRM ring manager") Signed-off-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b8fcd9ab0f
commit
25a4fb0e1a
@ -632,15 +632,15 @@ static int flexrm_spu_dma_map(struct device *dev, struct brcm_message *msg)
|
||||
|
||||
rc = dma_map_sg(dev, msg->spu.src, sg_nents(msg->spu.src),
|
||||
DMA_TO_DEVICE);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
if (!rc)
|
||||
return -EIO;
|
||||
|
||||
rc = dma_map_sg(dev, msg->spu.dst, sg_nents(msg->spu.dst),
|
||||
DMA_FROM_DEVICE);
|
||||
if (rc < 0) {
|
||||
if (!rc) {
|
||||
dma_unmap_sg(dev, msg->spu.src, sg_nents(msg->spu.src),
|
||||
DMA_TO_DEVICE);
|
||||
return rc;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user