Re: [PATCH v2] regcache: Do not overwrite error code when finalizing cache after error
From: Andy Shevchenko
Date: Wed Jun 17 2026 - 03:01:20 EST
On Wed, Jun 17, 2026 at 08:22:28AM +0200, Francesco Lavra wrote:
> During regcache initialization, if an error occurs in the
> cache_ops->populate callback, and if cache operations include an exit
> callback, the error code from populate() is overwritten with the return
> value from exit(). This hides the error condition from the caller of
> regcache_init(), and can cause NULL pointer dereferences when the regcache
> is later accessed.
Too quick to send.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
as per v1.
--
With Best Regards,
Andy Shevchenko