[patch] Staging: bcm2835-audio: fix an uninitialized return value
Dan Carpenter
dan.carpenter at oracle.com
Tue Feb 7 06:15:54 PST 2017
On Tue, Feb 07, 2017 at 03:01:23PM +0100, Arnd Bergmann wrote:
> On Tue, Feb 7, 2017 at 2:17 PM, Dan Carpenter <dan.carpenter at oracle.com> wrote:
> > "ret" isn't necessarily initialized on the success path.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
> >
>
> The patch seems correct, but do you have any idea why gcc-7 didn't
> warn about this?
Heh... I'm not a gcc dev. Checking for uninitialized variables is
harder than I would have thought though..
> I assume that you found it with smatch, and nobody else did.
Yep. I'm getting close to releasing my uninitialized variable check.
I guess the one thing holding me back is that I still have tons of false
positives caused by mismatches between "if (ret)" and "if (ret < 0)"
where the function assumes that non-zero is an error but the caller
assumes that errors are negative.
regards,
dan carpenter
More information about the linux-rpi-kernel
mailing list