Re: [PATCH] coresight: potential uninitialized variable in probe()

2019-06-17 Thread Mathieu Poirier
On Thu, 13 Jun 2019 at 00:59, Dan Carpenter wrote: > > The "drvdata->atclk" clock is optional, but if it gets set to an error > pointer then we're accidentally return an uninitialized variable instead > of success. > > Fixes: 78e6427b4e7b ("coresight: funnel: Support static funnel") > Signed-off-b

[PATCH] coresight: potential uninitialized variable in probe()

2019-06-13 Thread Dan Carpenter
The "drvdata->atclk" clock is optional, but if it gets set to an error pointer then we're accidentally return an uninitialized variable instead of success. Fixes: 78e6427b4e7b ("coresight: funnel: Support static funnel") Signed-off-by: Dan Carpenter --- drivers/hwtracing/coresight/coresight-funn

Re: [PATCH] coresight: potential uninitialized variable in probe()

2019-06-13 Thread Leo Yan
Hi Dan, On Wed, Jun 12, 2019 at 11:58:15PM -0700, Dan Carpenter wrote: > The "drvdata->atclk" clock is optional, but if it gets set to an error > pointer then we're accidentally return an uninitialized variable instead > of success. You are right, thanks a lot for pointing out. I'd like to initi

Re: [PATCH] coresight: potential uninitialized variable in probe()

2019-06-13 Thread Dan Carpenter
On Thu, Jun 13, 2019 at 03:49:22PM +0800, Leo Yan wrote: > Hi Dan, > > On Wed, Jun 12, 2019 at 11:58:15PM -0700, Dan Carpenter wrote: > > The "drvdata->atclk" clock is optional, but if it gets set to an error > > pointer then we're accidentally return an uninitialized variable instead > > of succe

Re: [PATCH] coresight: potential uninitialized variable in probe()

2019-06-13 Thread Leo Yan
Hi Dan, On Thu, Jun 13, 2019 at 11:14:19AM +0300, Dan Carpenter wrote: > On Thu, Jun 13, 2019 at 03:49:22PM +0800, Leo Yan wrote: > > Hi Dan, > > > > On Wed, Jun 12, 2019 at 11:58:15PM -0700, Dan Carpenter wrote: > > > The "drvdata->atclk" clock is optional, but if it gets set to an error > > > p

Re: [PATCH] coresight: potential uninitialized variable in probe()

2019-06-13 Thread Leo Yan
On Thu, Jun 13, 2019 at 05:56:37PM +0800, Leo Yan wrote: [...] > > In my experience it's better to initialize the return as late as > > possible so that you get static checker warnings when you forget to set > > the error code. > > Just want to check one thing, which static checker you are using