Kernel-Janitors Archive on lore.kernel.org
 help / color / Atom feed
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: Sun, 17 Sep 2017 22:33:06 +0000
Message-ID: <d4235bd2b9274e99f6c86ea71b1fa1c7bd8d0c08.1505687047.git.christophe.jaillet@wanadoo.fr> (raw)
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


  parent reply index

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

Kernel-Janitors Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernel-janitors/0 kernel-janitors/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernel-janitors kernel-janitors/ https://lore.kernel.org/kernel-janitors \
		kernel-janitors@vger.kernel.org
	public-inbox-index kernel-janitors

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kernel-janitors


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git