Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1443391 > unrolled thread

[PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()

Started byweiyj_lk@163.com
First post2016-07-14 14:10 +0200
Last post2016-07-16 02:20 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe() weiyj_lk@163.com - 2016-07-14 14:10 +0200
    Re: [PATCH -next] mtd: nand: omap2: fix return value check in  omap_nand_probe() Brian Norris <computersforpeace@gmail.com> - 2016-07-14 18:10 +0200
      Re: [PATCH -next] mtd: nand: omap2: fix return value check in  omap_nand_probe() Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-07-15 09:50 +0200
    Re: [PATCH -next] mtd: nand: omap2: fix return value check in  omap_nand_probe() Brian Norris <computersforpeace@gmail.com> - 2016-07-16 02:20 +0200

#1443391 — [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()

Fromweiyj_lk@163.com
Date2016-07-14 14:10 +0200
Subject[PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()
Message-ID<rUNCN-16b-9@gated-at.bofh.it>
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function dma_request_chan() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Fixes: aa7abd312c11 ('mtd: nand: omap2: Support parsing dma channel
information from DT')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/mtd/nand/omap2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index a36ad3d..26fbe29 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1922,9 +1922,9 @@ static int omap_nand_probe(struct platform_device *pdev)
 		dma_cap_set(DMA_SLAVE, mask);
 		info->dma = dma_request_chan(pdev->dev.parent, "rxtx");
 
-		if (!info->dma) {
+		if (IS_ERR(info->dma)) {
 			dev_err(&pdev->dev, "DMA engine request failed\n");
-			err = -ENXIO;
+			err = PTR_ERR(info->dma);
 			goto return_error;
 		} else {
 			struct dma_slave_config cfg;

[toc] | [next] | [standalone]


#1443559 — Re: [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()

FromBrian Norris <computersforpeace@gmail.com>
Date2016-07-14 18:10 +0200
SubjectRe: [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()
Message-ID<rURn4-3qz-21@gated-at.bofh.it>
In reply to#1443391
On Thu, Jul 14, 2016 at 12:06:45PM +0000, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function dma_request_chan() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
> 
> Fixes: aa7abd312c11 ('mtd: nand: omap2: Support parsing dma channel
> information from DT')
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Acked-by: Brian Norris <computersforpeace@gmail.com>

Boris,

The affected commit is in your pull request, which I might review/pull
today. I'll just plan on applying this on top, unless you'd prefer to
fixup and resend.

Brian

[toc] | [prev] | [next] | [standalone]


#1444016 — Re: [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-07-15 09:50 +0200
SubjectRe: [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()
Message-ID<rV62K-47o-15@gated-at.bofh.it>
In reply to#1443559
On Thu, 14 Jul 2016 09:05:39 -0700
Brian Norris <computersforpeace@gmail.com> wrote:

> On Thu, Jul 14, 2016 at 12:06:45PM +0000, weiyj_lk@163.com wrote:
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> > 
> > In case of error, the function dma_request_chan() returns ERR_PTR() and
> > never returns NULL. The NULL test in the return value check should be
> > replaced with IS_ERR().
> > 
> > Fixes: aa7abd312c11 ('mtd: nand: omap2: Support parsing dma channel
> > information from DT')
> > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>  
> 
> Acked-by: Brian Norris <computersforpeace@gmail.com>
> 
> Boris,
> 
> The affected commit is in your pull request, which I might review/pull
> today. I'll just plan on applying this on top, unless you'd prefer to
> fixup and resend.

Nope, you can apply it directly on top of my pull request (unless you
find other things to fix and want me to send a v3).

Thanks,

Boris

[toc] | [prev] | [next] | [standalone]


#1444689 — Re: [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()

FromBrian Norris <computersforpeace@gmail.com>
Date2016-07-16 02:20 +0200
SubjectRe: [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()
Message-ID<rVluN-5cw-1@gated-at.bofh.it>
In reply to#1443391
On Thu, Jul 14, 2016 at 12:06:45PM +0000, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function dma_request_chan() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
> 
> Fixes: aa7abd312c11 ('mtd: nand: omap2: Support parsing dma channel
> information from DT')
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied to l2-mtd.git

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web