public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH -next] mtd: nand: sunxi: fix return value check in sunxi_nfc_dma_op_prepare()
Date: Mon, 13 Jun 2016 22:06:25 +0200	[thread overview]
Message-ID: <20160613220625.020d01bd@bbrezillon> (raw)
In-Reply-To: <1465828038-16893-1-git-send-email-weiyj_lk@163.com>

On Mon, 13 Jun 2016 14:27:18 +0000
weiyj_lk at 163.com wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function dmaengine_prep_slave_sg() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value check
> should be replaced with NULL test.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied.

Thanks,

Boris

> ---
>  drivers/mtd/nand/sunxi_nand.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
> index ef7f6df..653cb3a 100644
> --- a/drivers/mtd/nand/sunxi_nand.c
> +++ b/drivers/mtd/nand/sunxi_nand.c
> @@ -390,8 +390,8 @@ static int sunxi_nfc_dma_op_prepare(struct mtd_info *mtd, const void *buf,
>  		return -ENOMEM;
>  
>  	dmad = dmaengine_prep_slave_sg(nfc->dmac, sg, 1, tdir, DMA_CTRL_ACK);
> -	if (IS_ERR(dmad)) {
> -		ret = PTR_ERR(dmad);
> +	if (!dmad) {
> +		ret = -EINVAL;
>  		goto err_unmap_buf;
>  	}
> 
> 



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

      reply	other threads:[~2016-06-13 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 14:27 [PATCH -next] mtd: nand: sunxi: fix return value check in sunxi_nfc_dma_op_prepare() weiyj_lk at 163.com
2016-06-13 20:06 ` 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=20160613220625.020d01bd@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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