[lvc-project] [PATCH] ASoC: nau8821: check regmap_raw_read/regmap_raw_write for failure

Andy Shevchenko andy.shevchenko at gmail.com
Fri Oct 18 14:36:57 MSK 2024


On Fri, Oct 18, 2024 at 2:07 PM Vitaliy Shevtsov <v.shevtsov at maxima.ru> wrote:
>
> The return values from both regmap_raw_read() and regmap_raw_write() are not
> checked despite they can fail. Propagate possible errors to caller.

"...them failing."
"...to the caller."

> Found by Linux Verification Center (linuxtesting.org) with Svace.

> Fixes: aab1ad11d69f ("ASoC: nau8821: new driver")

Are you sure?

While the code wise the patch is correct, the behaviour changes may be
catastrophic in some corner cases. The first one is the read where we
try to get the data from the register, that one may be okay, but the
write should be first put into the group of mandatory or optional IO.
If it's the second, why bother with the IO failure?

-- 
With Best Regards,
Andy Shevchenko



More information about the lvc-project mailing list