On Fri, Sep 12, 2025 at 12:51:05PM +0200, Thorsten Blum wrote: > On 12. Sep 2025, at 12:09, Thorsten Blum wrote: > > On 12. Sep 2025, at 11:56, Heiko Carstens wrote: > >> This is not an improvement and also incorrect, since kfree() may now > >> be called with an error pointer. > > > > Unless I'm missing something, kfree() works just fine with error > > pointers. See linux/slab.h: > > > > DEFINE_FREE(kfree, void *, if (!IS_ERR_OR_NULL(_T)) kfree(_T)) > > And unless kzalloc() is required here, memdup_user() is an improvement, > since it uses kmalloc() internally and avoids unnecessarily zeroing the > memory before overwriting it with copy_from_user(). Again, there are gazillions of similar trivial cleanup patches possible. The additional zeroing in this case doesn't matter at all, since this code is executed once a year. Reviewing and integrating such patches could keep us busy all day long. So, please don't send such patches. Patches which fix (potential) bugs are welcome however.