Re: [PATCH v2 3/5] regcache: flat: Remove unneeded check and error message for -ENOMEM
From: Andy Shevchenko
Date: Fri Oct 31 2025 - 04:03:52 EST
On Thu, Oct 30, 2025 at 09:18:11PM +0100, Sander Vanheule wrote:
> On Thu, 2025-10-30 at 18:37 +0100, Andy Shevchenko wrote:
> > There is a convention in the kernel to avoid error messages
> > in the cases of -ENOMEM errors. Besides that, the idea behind
> > using struct_size() and other macros from overflow.h is
> > to saturate the size that the following allocation call will
> > definitely fail, hence the check and the error messaging added
> > in regcache_flat_init() are redundant. Remove them.
> Makes sense, although I couldn't find the failure path myself in the code (it's probably
> too deep down in the memory management code). But I see now there are unit tests that
> check allocation failure for overflowed sizes.
>
> FWIW
>
> Acked-by: Sander Vanheule <sander@xxxxxxxxxxxxx>
Thanks for looking into this.
--
With Best Regards,
Andy Shevchenko