From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Roger Quadros <rogerq@ti.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
<yongjun_wei@trendmicro.com.cn>, "Cooper Jr.,
Franklin" <fcooper@ti.com>, Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org
Subject: Re: [bug report] mtd: nand: omap2: fix return value check in omap_nand_probe()
Date: Wed, 10 Aug 2016 15:48:34 +0200 [thread overview]
Message-ID: <20160810154834.5bd3c1f9@bbrezillon> (raw)
In-Reply-To: <bd02b812-5dc7-e431-bd8e-94b3edc706b1@ti.com>
Hi,
On Thu, 4 Aug 2016 10:05:09 +0300
Roger Quadros <rogerq@ti.com> wrote:
> +Franklin
>
> On 03/08/16 15:32, Dan Carpenter wrote:
> > Hello Wei Yongjun,
> >
> > The patch de3bfc4a1616: "mtd: nand: omap2: fix return value check in
> > omap_nand_probe()" from Jul 14, 2016, leads to the following static
> > checker warning:
> >
> > drivers/mtd/nand/omap2.c:2173 omap_nand_probe()
> > error: 'info->dma' dereferencing possible ERR_PTR()
> >
> > drivers/mtd/nand/omap2.c
> > 1921 case NAND_OMAP_PREFETCH_DMA:
> > 1922 dma_cap_zero(mask);
> > 1923 dma_cap_set(DMA_SLAVE, mask);
> > 1924 info->dma = dma_request_chan(pdev->dev.parent, "rxtx");
> > 1925
> > 1926 if (IS_ERR(info->dma)) {
> > ^^^^^^^^^
> > 1927 dev_err(&pdev->dev, "DMA engine request failed\n");
> > 1928 err = PTR_ERR(info->dma);
> > 1929 goto return_error;
> > 1930 } else {
> > 1931 struct dma_slave_config cfg;
> > 1932
> > 1933 memset(&cfg, 0, sizeof(cfg));
> > 1934 cfg.src_addr = info->phys_base;
> > 1935 cfg.dst_addr = info->phys_base;
> > 1936 cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
> > 1937 cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
> > 1938 cfg.src_maxburst = 16;
> > 1939 cfg.dst_maxburst = 16;
> > 1940 err = dmaengine_slave_config(info->dma, &cfg);
> > 1941 if (err) {
> > 1942 dev_err(&pdev->dev, "DMA engine slave config failed: %d\n",
> > 1943 err);
> > 1944 goto return_error;
> > 1945 }
> > 1946 nand_chip->read_buf = omap_read_buf_dma_pref;
> > 1947 nand_chip->write_buf = omap_write_buf_dma_pref;
> > 1948 }
> > 1949 break;
> > 1950
> >
> > [ snip ]
> >
> > 2170
> > 2171 return_error:
> > 2172 if (info->dma)
> > 2173 dma_release_channel(info->dma);
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > We can't pass error pointers to dma_release_channel(). I can't compile
> > this code though, so I'm not going to patch it.
if (!IS_ERR_OR_NULL(info->dma))
dma_release_channel(info->dma);
Should do the trick.
Franklin, Roger, can you check if I'm right and send a fix?
next prev parent reply other threads:[~2016-08-10 13:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 12:32 [bug report] mtd: nand: omap2: fix return value check in omap_nand_probe() Dan Carpenter
2016-08-04 7:05 ` Roger Quadros
2016-08-10 13:48 ` Boris Brezillon [this message]
2016-08-15 7:24 ` Roger Quadros
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=20160810154834.5bd3c1f9@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=dan.carpenter@oracle.com \
--cc=fcooper@ti.com \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
--cc=rogerq@ti.com \
--cc=yongjun_wei@trendmicro.com.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.