Messages in this thread | | | Date | Thu, 6 Jan 2022 20:05:15 +0000 | From | Mark Brown <> | Subject | Re: [PATCH v2] regmap: debugfs: Free debugfs_name buffer after usage |
| |
On Thu, Jan 06, 2022 at 04:27:32PM -0300, Fabio Estevam wrote: > On Thu, Jan 6, 2022 at 3:33 PM Mark Brown <broonie@kernel.org> wrote:
> > OK, but what's the logic here? The name is getting thrown away here but
> I did more debugging and this is what I found: > The 'debugfs: Directory 'dummy-iomuxc-gpr@20e0000' with parent > 'regmap' already present!' message > happens since commit cffa4b2122f5 ("regmap: debugfs: Fix a memory leak > when calling regmap_attach_dev").
Sure, but that just means that the bug with not cleaning up the directory predates that.
> # mount -t debugfs none /sys/kernel/debug/ > # cat /sys/kernel/debug/regmap/dummy-iomuxc-gpr@20e0000/registers > 00: 00000000 > 04: 48611005
What happens if the underlying regmap gets freed for some reason? It now only remembers the new name, not this old one, so it'll only know to clean up the old name.
> As shown above, I don't see the ' > /sys/kernel/debug/regmap/20e0000.pinctrl-gpr' directory being created, > so there is nothing to clean.
Creating that file is the behaviour you are demanding...
> Where exactly would you like me to call regmap_debugfs_exit()?
Before we try to reinitialise debugfs for the new name seems like the obvious place. [unhandled content-type:application/pgp-signature] | |