From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: mporter@kernel.crashing.org, alexandre.bounine@idt.com,
lstoakes@gmail.com, akpm@linux-foundation.org,
jesper.nilsson@axis.com, christian.koenig@amd.com,
logang@deltatee.com
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH 2/2] rapidio: Fix an error handling in 'rio_dma_transfer()'
Date: Mon, 18 Sep 2017 00:33:06 +0200 [thread overview]
Message-ID: <d4235bd2b9274e99f6c86ea71b1fa1c7bd8d0c08.1505687047.git.christophe.jaillet@wanadoo.fr> (raw)
In-Reply-To: <cover.1505687047.git.christophe.jaillet@wanadoo.fr>
In-Reply-To: <cover.1505687047.git.christophe.jaillet@wanadoo.fr>
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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/rapidio/devices/rio_mport_cdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
index 76afe1449cab..3dd37e35cf4e 100644
--- a/drivers/rapidio/devices/rio_mport_cdev.c
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
@@ -961,7 +961,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode,
nents = dma_map_sg(chan->device->dev,
req->sgt.sgl, req->sgt.nents, dir);
- if (nents == -EFAULT) {
+ if (nents == 0) {
rmcd_error("Failed to map SG list");
ret = -EFAULT;
goto err_pg;
--
2.11.0
next prev parent reply other threads:[~2017-09-17 22:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-17 22:33 [PATCH 0/2] rapidio: Two fixes for 'rio_dma_transfer()' Christophe JAILLET
2017-09-17 22:33 ` [PATCH 1/2] rapidio: Fix resources leak in error handling path in 'rio_dma_transfer()' Christophe JAILLET
2017-09-17 22:33 ` Christophe JAILLET [this message]
2017-09-18 16:04 ` [PATCH 0/2] rapidio: Two fixes for 'rio_dma_transfer()' Logan Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d4235bd2b9274e99f6c86ea71b1fa1c7bd8d0c08.1505687047.git.christophe.jaillet@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=akpm@linux-foundation.org \
--cc=alexandre.bounine@idt.com \
--cc=christian.koenig@amd.com \
--cc=jesper.nilsson@axis.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=lstoakes@gmail.com \
--cc=mporter@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).