From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: matthias.schiffer@ew.tq-group.com, linux-kernel@vger.kernel.org,
Fabio Estevam <festevam@gmail.com>
Subject: [PATCH] regmap: debugfs: Free the previous allocated debugfs_name buffer
Date: Thu, 6 Jan 2022 14:15:37 -0300 [thread overview]
Message-ID: <20220106171537.3091643-1-festevam@gmail.com> (raw)
The following error message is seen when booting an imx6q-sabresd:
debugfs: Directory 'dummy-iomuxc-gpr@20e0000' with parent 'regmap' already present!
By inspecting the duplicate directory name:
[ 0.274418] platform panel: Fixing up cyclic dependency with ldb
[ 0.276896] ************ 1: devname is dummy
[ 0.276926] ************ 2: name is iomuxc-gpr@20e0000
[ 0.276951] ************ 3: Forming the final name
[ 0.276979] ************ 3a: Name from map->debugfs_name dummy-iomuxc-gpr@20e0000
[ 0.277001] ************ 4: name is dummy-iomuxc-gpr@20e0000
[ 0.277022] ************ 5: Final name is dummy-iomuxc-gpr@20e0000
[ 0.277746] No ATAGs?
[ 0.278355] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[ 0.278469] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.282007] ********** gpr succeeded
[ 0.282042] ************ 1: devname is 20e0000.pinctrl
[ 0.282070] ************ 2: name is gpr
[ 0.282093] ************ 3a: Name from map->debugfs_name dummy-iomuxc-gpr@20e0000
[ 0.282115] ************ 4: name is dummy-iomuxc-gpr@20e0000
[ 0.282138] ************ 5: Final name is dummy-iomuxc-gpr@20e0000
[ 0.282185] debugfs: Directory 'dummy-iomuxc-gpr@20e0000' with parent 'regmap' already present!
The 'dummy-iomuxc-gpr@20e0000' name is caused by a non-freed map->debugfs_name
buffer.
After calling kfree(map->debugfs_name), no more duplicate naming is seen:
After:
[ 0.257135] platform 2800000.ipu: Fixing up cyclic dependency with 120000.hdmi
[ 0.257460] platform 2800000.ipu: Fixing up cyclic dependency with 20e0000.iomuxc-gpr:ipu2_csi1_mux
[ 0.257782] platform 2800000.ipu: Fixing up cyclic dependency with 21dc000.mipi
[ 0.273536] platform panel: Fixing up cyclic dependency with ldb
[ 0.276013] ************ 1: devname is dummy
[ 0.276043] ************ 2: name is iomuxc-gpr@20e0000
[ 0.276067] ************ 3: Forming the final name
[ 0.276097] ************ 3a: Name from map->debugfs_name dummy-iomuxc-gpr@20e0000
[ 0.276119] ************ 4: name is dummy-iomuxc-gpr@20e0000
[ 0.276141] ************ 5: Final name is dummy-iomuxc-gpr@20e0000
[ 0.276859] No ATAGs?
[ 0.277468] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[ 0.277580] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.281122] ********** gpr succeeded
[ 0.281156] ************ 1: devname is 20e0000.pinctrl
[ 0.281184] ************ 2: name is gpr
[ 0.281206] ************ 3a: Name from map->debugfs_name 20e0000.pinctrl
[ 0.281228] ************ 4: name is 20e0000.pinctrl
[ 0.281251] ************ 5: Final name is 20e0000.pinctrl
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
drivers/base/regmap/regmap-debugfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index ad684d37c2da..18f0c7223082 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -589,6 +589,7 @@ void regmap_debugfs_init(struct regmap *map)
return;
}
name = map->debugfs_name;
+ kfree(map->debugfs_name);
} else {
name = devname;
}
@@ -600,6 +601,7 @@ void regmap_debugfs_init(struct regmap *map)
if (!map->debugfs_name)
return;
name = map->debugfs_name;
+ kfree(map->debugfs_name);
dummy_index++;
}
--
2.25.1
next reply other threads:[~2022-01-06 17:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-06 17:15 Fabio Estevam [this message]
2022-01-06 17:31 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220106171537.3091643-1-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.schiffer@ew.tq-group.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome