From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Pan Bian <bianpan2016@163.com>
Cc: Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: mtd: nand: use dma_mapping_error to check map errors
Date: Sun, 13 Aug 2017 09:56:48 +0200 [thread overview]
Message-ID: <20170813095648.4a2a2764@bbrezillon> (raw)
In-Reply-To: <1502202942-23984-1-git-send-email-bianpan2016@163.com>
Le Tue, 8 Aug 2017 22:35:42 +0800,
Pan Bian <bianpan2016@163.com> a écrit :
> The return value of dma_map_single() should be checked by
> dma_mapping_error(). However, in function flctl_dma_fifo0_transfer(), its
> return value is checked against NULL, which could result in failures.
Applied, thanks.
Boris
>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
> drivers/mtd/nand/sh_flctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
> index 891ac7b..2404d66 100644
> --- a/drivers/mtd/nand/sh_flctl.c
> +++ b/drivers/mtd/nand/sh_flctl.c
> @@ -411,7 +411,7 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
>
> dma_addr = dma_map_single(chan->device->dev, buf, len, dir);
>
> - if (dma_addr)
> + if (!dma_mapping_error(chan->device->dev, dma_addr))
> desc = dmaengine_prep_slave_single(chan, dma_addr, len,
> tr_dir, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>
prev parent reply other threads:[~2017-08-13 7:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 14:35 mtd: nand: use dma_mapping_error to check map errors Pan Bian
2017-08-13 7:56 ` Boris Brezillon [this message]
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=20170813095648.4a2a2764@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=bianpan2016@163.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
/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