Commit c46d90cd authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Linus Torvalds
Browse files

drivers/rapidio/devices/rio_mport_cdev.c: fix error handling in 'rio_dma_transfer()'

In case of error, 'dma_map_sg()' returns 0, not a negative value.  There
is BUG_ON() in 'dma_map_sg_attrs()' which makes sure of that.


Signed-off-by: default avatarChristophe JAILLET <>
Reviewed-by: default avatarLogan Gunthorpe <>
Cc: Matt Porter <>
Cc: Alexandre Bounine <>
Cc: Lorenzo Stoakes <>
Cc: Jesper Nilsson <>
Cc: Christian K_nig <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent b1402dcb
...@@ -961,7 +961,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, ...@@ -961,7 +961,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode,
nents = dma_map_sg(chan->device->dev, nents = dma_map_sg(chan->device->dev,
req->sgt.sgl, req->sgt.nents, dir); req->sgt.sgl, req->sgt.nents, dir);
if (nents == -EFAULT) { if (nents == 0) {
rmcd_error("Failed to map SG list"); rmcd_error("Failed to map SG list");
ret = -EFAULT; ret = -EFAULT;
goto err_pg; goto err_pg;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment