Re: [patch] powerpc/fsl_rio: fix a missing error code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> 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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux