<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/base/regmap/regmap-debugfs.c, branch v5.11-rc3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init()</title>
<updated>2021-01-05T14:34:41+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2021-01-05T11:42:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f6bcb4c7f366905b66ce8ffca7190118244bb642'/>
<id>f6bcb4c7f366905b66ce8ffca7190118244bb642</id>
<content type='text'>
This code will leak "map-&gt;debugfs_name" because the if statement is
reversed so it only frees NULL pointers instead of non-NULL.  In
fact the if statement is not required and should just be removed
because kfree() accepts NULL pointers.

Fixes: cffa4b2122f5 ("regmap: debugfs: Fix a memory leak when calling regmap_attach_dev")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/X/RQpfAwRdLg0GqQ@mwanda
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This code will leak "map-&gt;debugfs_name" because the if statement is
reversed so it only frees NULL pointers instead of non-NULL.  In
fact the if statement is not required and should just be removed
because kfree() accepts NULL pointers.

Fixes: cffa4b2122f5 ("regmap: debugfs: Fix a memory leak when calling regmap_attach_dev")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/X/RQpfAwRdLg0GqQ@mwanda
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Fix a memory leak when calling regmap_attach_dev</title>
<updated>2020-12-29T13:17:33+00:00</updated>
<author>
<name>Xiaolei Wang</name>
<email>xiaolei.wang@windriver.com</email>
</author>
<published>2020-12-29T10:50:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cffa4b2122f5f3e53cf3d529bbc74651f95856d5'/>
<id>cffa4b2122f5f3e53cf3d529bbc74651f95856d5</id>
<content type='text'>
After initializing the regmap through
syscon_regmap_lookup_by_compatible, then regmap_attach_dev to the
device, because the debugfs_name has been allocated, there is no
need to redistribute it again

unreferenced object 0xd8399b80 (size 64):
  comm "swapper/0", pid 1, jiffies 4294937641 (age 278.590s)
  hex dump (first 32 bytes):
	64 75 6d 6d 79 2d 69 6f 6d 75 78 63 2d 67 70 72
dummy-iomuxc-gpr
	40 32 30 65 34 30 30 30 00 7f 52 5b d8 7e 42 69
@20e4000..R[.~Bi
  backtrace:
    [&lt;ca384d6f&gt;] kasprintf+0x2c/0x54
    [&lt;6ad3bbc2&gt;] regmap_debugfs_init+0xdc/0x2fc
    [&lt;bc4181da&gt;] __regmap_init+0xc38/0xd88
    [&lt;1f7e0609&gt;] of_syscon_register+0x168/0x294
    [&lt;735e8766&gt;] device_node_get_regmap+0x6c/0x98
    [&lt;d96c8982&gt;] imx6ul_init_machine+0x20/0x88
    [&lt;0456565b&gt;] customize_machine+0x1c/0x30
    [&lt;d07393d8&gt;] do_one_initcall+0x80/0x3ac
    [&lt;7e584867&gt;] kernel_init_freeable+0x170/0x1f0
    [&lt;80074741&gt;] kernel_init+0x8/0x120
    [&lt;285d6f28&gt;] ret_from_fork+0x14/0x20
    [&lt;00000000&gt;] 0x0

Fixes: 9b947a13e7f6 ("regmap: use debugfs even when no device")
Signed-off-by: Xiaolei Wang &lt;xiaolei.wang@windriver.com&gt;
Link: https://lore.kernel.org/r/20201229105046.41984-1-xiaolei.wang@windriver.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After initializing the regmap through
syscon_regmap_lookup_by_compatible, then regmap_attach_dev to the
device, because the debugfs_name has been allocated, there is no
need to redistribute it again

unreferenced object 0xd8399b80 (size 64):
  comm "swapper/0", pid 1, jiffies 4294937641 (age 278.590s)
  hex dump (first 32 bytes):
	64 75 6d 6d 79 2d 69 6f 6d 75 78 63 2d 67 70 72
dummy-iomuxc-gpr
	40 32 30 65 34 30 30 30 00 7f 52 5b d8 7e 42 69
@20e4000..R[.~Bi
  backtrace:
    [&lt;ca384d6f&gt;] kasprintf+0x2c/0x54
    [&lt;6ad3bbc2&gt;] regmap_debugfs_init+0xdc/0x2fc
    [&lt;bc4181da&gt;] __regmap_init+0xc38/0xd88
    [&lt;1f7e0609&gt;] of_syscon_register+0x168/0x294
    [&lt;735e8766&gt;] device_node_get_regmap+0x6c/0x98
    [&lt;d96c8982&gt;] imx6ul_init_machine+0x20/0x88
    [&lt;0456565b&gt;] customize_machine+0x1c/0x30
    [&lt;d07393d8&gt;] do_one_initcall+0x80/0x3ac
    [&lt;7e584867&gt;] kernel_init_freeable+0x170/0x1f0
    [&lt;80074741&gt;] kernel_init+0x8/0x120
    [&lt;285d6f28&gt;] ret_from_fork+0x14/0x20
    [&lt;00000000&gt;] 0x0

Fixes: 9b947a13e7f6 ("regmap: use debugfs even when no device")
Signed-off-by: Xiaolei Wang &lt;xiaolei.wang@windriver.com&gt;
Link: https://lore.kernel.org/r/20201229105046.41984-1-xiaolei.wang@windriver.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'regmap/for-5.10' into regmap-next</title>
<updated>2020-10-05T17:53:24+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2020-10-05T17:53:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6e0545c4f08368e67496111778a726f9a2031f26'/>
<id>6e0545c4f08368e67496111778a726f9a2031f26</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: use semicolons rather than commas to separate statements</title>
<updated>2020-09-28T17:16:12+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@inria.fr</email>
</author>
<published>2020-09-27T19:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7f4a122d0b50b40c64d24a5cf7aafe26dd9487ee'/>
<id>7f4a122d0b50b40c64d24a5cf7aafe26dd9487ee</id>
<content type='text'>
Replace commas with semicolons.  What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):

// &lt;smpl&gt;
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Link: https://lore.kernel.org/r/1601233948-11629-15-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace commas with semicolons.  What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):

// &lt;smpl&gt;
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Link: https://lore.kernel.org/r/1601233948-11629-15-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Fix handling of name string for debugfs init delays</title>
<updated>2020-09-17T17:54:20+00:00</updated>
<author>
<name>Charles Keepax</name>
<email>ckeepax@opensource.cirrus.com</email>
</author>
<published>2020-09-17T12:08:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=94cc89eb8fa5039fcb6e3e3d50f929ddcccee095'/>
<id>94cc89eb8fa5039fcb6e3e3d50f929ddcccee095</id>
<content type='text'>
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 after free, where config-&gt;name has been freed by
the time it is used in regmap_debugfs_initcall.

This situation can be seen on Zynq, where the architecture init_irq
callback registers a syscon device, using a local variable for the
regmap_config. As init_irq is very early in the platform bring up the
regmap debugfs root isn't ready yet. Although this doesn't crash it
does result in the debugfs entry not having the correct name.

Regmap already sets map-&gt;name from config-&gt;name on the regmap_init
path and the fact that a separate field is used to pass the name
to regmap_debugfs_init appears to be an artifact of the debugfs
name being added before the map name. As such this patch updates
regmap_debugfs_init to use map-&gt;name, which is already duplicated from
the config avoiding the issue.

This does however leave two lose ends, both regmap_attach_dev and
regmap_reinit_cache can be called after a regmap is registered and
would have had the effect of applying a new name to the debugfs
entries. In both of these cases it was chosen to update the map
name. In the case of regmap_attach_dev there are 3 users that
currently use this function to update the name, thus doing so avoids
changes for those users and it seems reasonable that attaching
a device would want to set the name of the map. In the case of
regmap_reinit_cache the primary use-case appears to be devices that
need some register access to identify the device (for example devices
in the same family) and then update the cache to match the exact
hardware. Whilst no users do currently update the name here, given the
use-case it seemed reasonable the name might want to be updated once
the device is better identified.

Signed-off-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Link: https://lore.kernel.org/r/20200917120828.12987-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 after free, where config-&gt;name has been freed by
the time it is used in regmap_debugfs_initcall.

This situation can be seen on Zynq, where the architecture init_irq
callback registers a syscon device, using a local variable for the
regmap_config. As init_irq is very early in the platform bring up the
regmap debugfs root isn't ready yet. Although this doesn't crash it
does result in the debugfs entry not having the correct name.

Regmap already sets map-&gt;name from config-&gt;name on the regmap_init
path and the fact that a separate field is used to pass the name
to regmap_debugfs_init appears to be an artifact of the debugfs
name being added before the map name. As such this patch updates
regmap_debugfs_init to use map-&gt;name, which is already duplicated from
the config avoiding the issue.

This does however leave two lose ends, both regmap_attach_dev and
regmap_reinit_cache can be called after a regmap is registered and
would have had the effect of applying a new name to the debugfs
entries. In both of these cases it was chosen to update the map
name. In the case of regmap_attach_dev there are 3 users that
currently use this function to update the name, thus doing so avoids
changes for those users and it seems reasonable that attaching
a device would want to set the name of the map. In the case of
regmap_reinit_cache the primary use-case appears to be devices that
need some register access to identify the device (for example devices
in the same family) and then update the cache to match the exact
hardware. Whilst no users do currently update the name here, given the
use-case it seemed reasonable the name might want to be updated once
the device is better identified.

Signed-off-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Link: https://lore.kernel.org/r/20200917120828.12987-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'regmap-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into master</title>
<updated>2020-07-17T16:58:18+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-07-17T16:58:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ee43695571c258c0945d4c456ea85b2af9aafdf4'/>
<id>ee43695571c258c0945d4c456ea85b2af9aafdf4</id>
<content type='text'>
Pull regmap fixes from Mark Brown:
 "A couple of substantial fixes here, one from Doug which fixes the
  debugfs code for MMIO regmaps (fortunately not the common case) and
  one from Marc fixing lookups of multiple regmaps for the same device
  (a very unusual case).

  There's also a fix for Kconfig to ensure we enable SoundWire properly"

* tag 'regmap-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: debugfs: Don't sleep while atomic for fast_io regmaps
  regmap: add missing dependency on SoundWire
  regmap: dev_get_regmap_match(): fix string comparison
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull regmap fixes from Mark Brown:
 "A couple of substantial fixes here, one from Doug which fixes the
  debugfs code for MMIO regmaps (fortunately not the common case) and
  one from Marc fixing lookups of multiple regmaps for the same device
  (a very unusual case).

  There's also a fix for Kconfig to ensure we enable SoundWire properly"

* tag 'regmap-fix-v5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: debugfs: Don't sleep while atomic for fast_io regmaps
  regmap: add missing dependency on SoundWire
  regmap: dev_get_regmap_match(): fix string comparison
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Don't sleep while atomic for fast_io regmaps</title>
<updated>2020-07-16T19:41:58+00:00</updated>
<author>
<name>Douglas Anderson</name>
<email>dianders@chromium.org</email>
</author>
<published>2020-07-15T23:46:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=299632e54b2e692d2830af84be51172480dc1e26'/>
<id>299632e54b2e692d2830af84be51172480dc1e26</id>
<content type='text'>
If a regmap has "fast_io" set then its lock function uses a spinlock.
That doesn't work so well with the functions:
* regmap_cache_only_write_file()
* regmap_cache_bypass_write_file()

Both of the above functions have the pattern:
1. Lock the regmap.
2. Call:
   debugfs_write_file_bool()
     copy_from_user()
       __might_fault()
         __might_sleep()

Let's reorder things a bit so that we do all of our sleepable
functions before we grab the lock.

Fixes: d3dc5430d68f ("regmap: debugfs: Allow writes to cache state settings")
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Link: https://lore.kernel.org/r/20200715164611.1.I35b3533e8a80efde0cec1cc70f71e1e74b2fa0da@changeid
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a regmap has "fast_io" set then its lock function uses a spinlock.
That doesn't work so well with the functions:
* regmap_cache_only_write_file()
* regmap_cache_bypass_write_file()

Both of the above functions have the pattern:
1. Lock the regmap.
2. Call:
   debugfs_write_file_bool()
     copy_from_user()
       __might_fault()
         __might_sleep()

Let's reorder things a bit so that we do all of our sleepable
functions before we grab the lock.

Fixes: d3dc5430d68f ("regmap: debugfs: Allow writes to cache state settings")
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Link: https://lore.kernel.org/r/20200715164611.1.I35b3533e8a80efde0cec1cc70f71e1e74b2fa0da@changeid
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: check count when read regmap file</title>
<updated>2020-03-13T16:33:58+00:00</updated>
<author>
<name>Peng Fan</name>
<email>peng.fan@nxp.com</email>
</author>
<published>2020-03-13T01:58:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=74edd08a4fbf51d65fd8f4c7d8289cd0f392bd91'/>
<id>74edd08a4fbf51d65fd8f4c7d8289cd0f392bd91</id>
<content type='text'>
When executing the following command, we met kernel dump.
dmesg -c &gt; /dev/null; cd /sys;
for i in `ls /sys/kernel/debug/regmap/* -d`; do
	echo "Checking regmap in $i";
	cat $i/registers;
done &amp;&amp; grep -ri "0x02d0" *;

It is because the count value is too big, and kmalloc fails. So add an
upper bound check to allow max size `PAGE_SIZE &lt;&lt; (MAX_ORDER - 1)`.

Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Link: https://lore.kernel.org/r/1584064687-12964-1-git-send-email-peng.fan@nxp.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When executing the following command, we met kernel dump.
dmesg -c &gt; /dev/null; cd /sys;
for i in `ls /sys/kernel/debug/regmap/* -d`; do
	echo "Checking regmap in $i";
	cat $i/registers;
done &amp;&amp; grep -ri "0x02d0" *;

It is because the count value is too big, and kmalloc fails. So add an
upper bound check to allow max size `PAGE_SIZE &lt;&lt; (MAX_ORDER - 1)`.

Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Link: https://lore.kernel.org/r/1584064687-12964-1-git-send-email-peng.fan@nxp.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: no need to check return value of debugfs_create functions</title>
<updated>2019-08-01T13:06:56+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-07-31T13:29:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9d52a35ebd4bb6e495ab06e4ce1f568daa0f70e1'/>
<id>9d52a35ebd4bb6e495ab06e4ce1f568daa0f70e1</id>
<content type='text'>
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

The debugfs core will warn if a file or directory can not be created, so
there's no need to duplicate the warning, nor really do anything else.

Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20190731132923.GA13829@kroah.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

The debugfs core will warn if a file or directory can not be created, so
there's no need to duplicate the warning, nor really do anything else.

Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20190731132923.GA13829@kroah.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Fix memory leak in regmap_debugfs_init</title>
<updated>2019-05-20T14:23:29+00:00</updated>
<author>
<name>Daniel Baluta</name>
<email>daniel.baluta@nxp.com</email>
</author>
<published>2019-05-17T13:23:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2899872b627e99b7586fe3b6c9f861da1b4d5072'/>
<id>2899872b627e99b7586fe3b6c9f861da1b4d5072</id>
<content type='text'>
As detected by kmemleak running on i.MX6ULL board:

nreferenced object 0xd8366600 (size 64):
  comm "swapper/0", pid 1, jiffies 4294937370 (age 933.220s)
  hex dump (first 32 bytes):
    64 75 6d 6d 79 2d 69 6f 6d 75 78 63 2d 67 70 72  dummy-iomuxc-gpr
    40 32 30 65 34 30 30 30 00 e3 f3 ab fe d1 1b dd  @20e4000........
  backtrace:
    [&lt;b0402aec&gt;] kasprintf+0x2c/0x54
    [&lt;a6fbad2c&gt;] regmap_debugfs_init+0x7c/0x31c
    [&lt;9c8d91fa&gt;] __regmap_init+0xb5c/0xcf4
    [&lt;5b1c3d2a&gt;] of_syscon_register+0x164/0x2c4
    [&lt;596a5d80&gt;] syscon_node_to_regmap+0x64/0x90
    [&lt;49bd597b&gt;] imx6ul_init_machine+0x34/0xa0
    [&lt;250a4dac&gt;] customize_machine+0x1c/0x30
    [&lt;2d19fdaf&gt;] do_one_initcall+0x7c/0x398
    [&lt;e6084469&gt;] kernel_init_freeable+0x328/0x448
    [&lt;168c9101&gt;] kernel_init+0x8/0x114
    [&lt;913268aa&gt;] ret_from_fork+0x14/0x20
    [&lt;ce7b131a&gt;] 0x0

Root cause is that map-&gt;debugfs_name is allocated using kasprintf
and then the pointer is lost by assigning it other memory address.

Reported-by: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Signed-off-by: Daniel Baluta &lt;daniel.baluta@nxp.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As detected by kmemleak running on i.MX6ULL board:

nreferenced object 0xd8366600 (size 64):
  comm "swapper/0", pid 1, jiffies 4294937370 (age 933.220s)
  hex dump (first 32 bytes):
    64 75 6d 6d 79 2d 69 6f 6d 75 78 63 2d 67 70 72  dummy-iomuxc-gpr
    40 32 30 65 34 30 30 30 00 e3 f3 ab fe d1 1b dd  @20e4000........
  backtrace:
    [&lt;b0402aec&gt;] kasprintf+0x2c/0x54
    [&lt;a6fbad2c&gt;] regmap_debugfs_init+0x7c/0x31c
    [&lt;9c8d91fa&gt;] __regmap_init+0xb5c/0xcf4
    [&lt;5b1c3d2a&gt;] of_syscon_register+0x164/0x2c4
    [&lt;596a5d80&gt;] syscon_node_to_regmap+0x64/0x90
    [&lt;49bd597b&gt;] imx6ul_init_machine+0x34/0xa0
    [&lt;250a4dac&gt;] customize_machine+0x1c/0x30
    [&lt;2d19fdaf&gt;] do_one_initcall+0x7c/0x398
    [&lt;e6084469&gt;] kernel_init_freeable+0x328/0x448
    [&lt;168c9101&gt;] kernel_init+0x8/0x114
    [&lt;913268aa&gt;] ret_from_fork+0x14/0x20
    [&lt;ce7b131a&gt;] 0x0

Root cause is that map-&gt;debugfs_name is allocated using kasprintf
and then the pointer is lost by assigning it other memory address.

Reported-by: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Signed-off-by: Daniel Baluta &lt;daniel.baluta@nxp.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
