Re: [PATCH] regmap: debugfs: Duplicate name string if delaying debugfs init

2020-09-16 Thread Mark Brown
On Wed, Sep 16, 2020 at 04:44:33PM +0100, Charles Keepax wrote: > - node->name = name; > + node->name = kstrdup(name, GFP_KERNEL); > + if (!node->name) { Two things here - one is that this should be kstrdup_const(), the other is that we already took a copy of

[PATCH] regmap: debugfs: Duplicate name string if delaying debugfs init

2020-09-16 Thread Charles Keepax
In regmap_debugfs_init the initialisation of the debugfs is delayed if the root node isn't ready yet. Most callers of regmap_debugfs_init pass the name from the regmap_config, which is considered temporary ie. may be unallocated after the regmap_init call returns. This leads to a potential use

Re: [PATCH] regmap: debugfs: Duplicate name string if delaying debugfs init

2020-09-16 Thread Charles Keepax
On Wed, Sep 16, 2020 at 05:14:18PM +0100, Mark Brown wrote: > On Wed, Sep 16, 2020 at 04:44:33PM +0100, Charles Keepax wrote: > > > - node->name = name; > > + node->name = kstrdup(name, GFP_KERNEL); > > + if (!node->name) { > > Two things here - one is that this