From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Alexandre Bounine <alexandre.bounine@idt.com>,
linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] powerpc/fsl_rio: fix a missing error code
Date: Fri, 05 Aug 2016 20:28:16 +0000 [thread overview]
Message-ID: <20160805202815.GB4186@mwanda> (raw)
In-Reply-To: <20160804131600.bd2f72d2a0a6d8deec0af79b@linux-foundation.org>
On Thu, Aug 04, 2016 at 01:16:00PM -0700, Andrew Morton wrote:
> On Thu, 4 Aug 2016 08:35:25 +0300 Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> > We should set the error code here. Otherwise static checkers complain.
> >
>
> hm.
>
> > --- a/arch/powerpc/sysdev/fsl_rio.c
> > +++ b/arch/powerpc/sysdev/fsl_rio.c
> > @@ -491,6 +491,7 @@ int fsl_rio_setup(struct platform_device *dev)
> > rmu_node = of_parse_phandle(dev->dev.of_node, "fsl,srio-rmu-handle", 0);
> > if (!rmu_node) {
> > dev_err(&dev->dev, "No valid fsl,srio-rmu-handle property\n");
> > + rc = -ENOENT;
> > goto err_rmu;
> > }
> > rc = of_address_to_resource(rmu_node, 0, &rmu_regs);
>
> afaict the function will return 0 in this case, which is a flat out
> bug. But why do static checkers complain? The code will return a
> suitably initialized value?
>
> IOW, please always quote the checker/compiler output when fixing a bug!
Coccinelle has a check for missing error codes and I'm working on one
for Smatch as well.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Alexandre Bounine <alexandre.bounine@idt.com>,
linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] powerpc/fsl_rio: fix a missing error code
Date: Fri, 5 Aug 2016 23:28:16 +0300 [thread overview]
Message-ID: <20160805202815.GB4186@mwanda> (raw)
In-Reply-To: <20160804131600.bd2f72d2a0a6d8deec0af79b@linux-foundation.org>
On Thu, Aug 04, 2016 at 01:16:00PM -0700, Andrew Morton wrote:
> On Thu, 4 Aug 2016 08:35:25 +0300 Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> > We should set the error code here. Otherwise static checkers complain.
> >
>
> hm.
>
> > --- a/arch/powerpc/sysdev/fsl_rio.c
> > +++ b/arch/powerpc/sysdev/fsl_rio.c
> > @@ -491,6 +491,7 @@ int fsl_rio_setup(struct platform_device *dev)
> > rmu_node = of_parse_phandle(dev->dev.of_node, "fsl,srio-rmu-handle", 0);
> > if (!rmu_node) {
> > dev_err(&dev->dev, "No valid fsl,srio-rmu-handle property\n");
> > + rc = -ENOENT;
> > goto err_rmu;
> > }
> > rc = of_address_to_resource(rmu_node, 0, &rmu_regs);
>
> afaict the function will return 0 in this case, which is a flat out
> bug. But why do static checkers complain? The code will return a
> suitably initialized value?
>
> IOW, please always quote the checker/compiler output when fixing a bug!
Coccinelle has a check for missing error codes and I'm working on one
for Smatch as well.
regards,
dan carpenter
next prev parent reply other threads:[~2016-08-05 20:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-04 5:35 [patch] powerpc/fsl_rio: fix a missing error code Dan Carpenter
2016-08-04 5:35 ` Dan Carpenter
2016-08-04 20:16 ` Andrew Morton
2016-08-04 20:16 ` Andrew Morton
2016-08-05 20:28 ` Dan Carpenter [this message]
2016-08-05 20:28 ` Dan Carpenter
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=20160805202815.GB4186@mwanda \
--to=dan.carpenter@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=alexandre.bounine@idt.com \
--cc=benh@kernel.crashing.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.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 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.