Re: [PATCH 1/2] nvmem: core: clear sysfs attributes for each NVMEM device

From: Greg Kroah-Hartman
Date: Tue Jul 18 2023 - 10:43:33 EST


On Tue, Jul 18, 2023 at 02:55:31PM +0100, Daniel Golle wrote:
> Set nvmem_cells_group.bin_attrs to NULL in case of an NVMEM device not
> having any cells in order to make sure sysfs attributes of a previously
> registered NVMEM device are not accidentally reused for a follow-up
> device which doesn't have any cells.

Wait, attributes and devices should NEVER be reused, how is that
happening here?

And just setting the attribute field to NULL doesn't free or clean up
anything, right? Did memory just leak with this?

confused,

greg k-h