Re: [PATCH] ASoC: sma1307: fix uninitialized variable refence

From: Mark Brown
Date: Thu Nov 14 2024 - 06:33:30 EST


On Wed, Nov 13, 2024 at 11:43:12PM +0100, Arnd Bergmann wrote:
> On Wed, Nov 13, 2024, at 14:24, Mark Brown wrote:

> > There is one path in the actual implementation that returns an error
> > code without setting fw, though most do. Either this caller should be
> > updated to check the return code or if checking fw alone is valid (which
> > TBH does look like the intent) the stub should be updated to set it.

> From what I saw earlier, the fw pointer gets set exactly in the
> same cases that return success (through *firmware_p), checking one
> or the other is almost the same, but you are totally right checking
> the return code is the right thing to do here, plus it avoids
> the pointless release_firmware(NULL).

Yeah, the case I noticed that doesn't set firmware_p is the check for
firmware_p where it's kind of unavoidable.

Attachment: signature.asc
Description: PGP signature