linux-stable/drivers/base/regmap
Xiaolei Wang cffa4b2122
regmap: debugfs: Fix a memory leak when calling regmap_attach_dev
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:
    [<ca384d6f>] kasprintf+0x2c/0x54
    [<6ad3bbc2>] regmap_debugfs_init+0xdc/0x2fc
    [<bc4181da>] __regmap_init+0xc38/0xd88
    [<1f7e0609>] of_syscon_register+0x168/0x294
    [<735e8766>] device_node_get_regmap+0x6c/0x98
    [<d96c8982>] imx6ul_init_machine+0x20/0x88
    [<0456565b>] customize_machine+0x1c/0x30
    [<d07393d8>] do_one_initcall+0x80/0x3ac
    [<7e584867>] kernel_init_freeable+0x170/0x1f0
    [<80074741>] kernel_init+0x8/0x120
    [<285d6f28>] ret_from_fork+0x14/0x20
    [<00000000>] 0x0

Fixes: 9b947a13e7 ("regmap: use debugfs even when no device")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Link: https://lore.kernel.org/r/20201229105046.41984-1-xiaolei.wang@windriver.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29 13:17:33 +00:00
..
internal.h Merge remote-tracking branch 'regmap/for-5.10' into regmap-next 2020-10-05 18:53:24 +01:00
Kconfig regmap/SoundWire: sdw: add support for SoundWire 1.2 MBQ 2020-11-26 13:19:59 +00:00
Makefile regmap/SoundWire: sdw: add support for SoundWire 1.2 MBQ 2020-11-26 13:19:59 +00:00
regcache-flat.c regmap: add proper SPDX identifiers on files that did not have them. 2019-04-25 20:22:15 +01:00
regcache-lzo.c regmap: lzo: Switch to bitmap_zalloc() 2019-06-17 15:18:44 +01:00
regcache-rbtree.c regmap: add proper SPDX identifiers on files that did not have them. 2019-04-25 20:22:15 +01:00
regcache.c regmap: fix page selection for noinc writes 2020-09-21 20:58:02 +01:00
regmap-ac97.c regmap: add proper SPDX identifiers on files that did not have them. 2019-04-25 20:22:15 +01:00
regmap-debugfs.c regmap: debugfs: Fix a memory leak when calling regmap_attach_dev 2020-12-29 13:17:33 +00:00
regmap-i2c.c regmap-i2c: add 16-bit width registers support 2020-04-24 14:32:07 +01:00
regmap-i3c.c regmap: add i3c bus support 2019-06-07 13:09:55 +01:00
regmap-irq.c regmap: irq: Convert to use irq_domain_create_legacy() 2020-11-07 11:33:46 +01:00
regmap-mmio.c regmap: mmio: add config option to allow relaxed MMIO accesses 2020-10-26 19:54:59 +00:00
regmap-sccb.c regmap: sccb: fix typo and sort headers alphabetically 2018-07-23 18:05:08 +01:00
regmap-sdw-mbq.c regmap/SoundWire: sdw: add support for SoundWire 1.2 MBQ 2020-11-26 13:19:59 +00:00
regmap-sdw.c regmap: sdw: add required header files 2020-11-26 13:08:14 +00:00
regmap-slimbus.c regmap: slimbus: add support to multi read/write 2018-07-11 11:58:04 +01:00
regmap-spi-avmm.c regmap: add Intel SPI Slave to AVMM Bus Bridge support 2020-08-26 19:46:38 +01:00
regmap-spi.c regmap: add proper SPDX identifiers on files that did not have them. 2019-04-25 20:22:15 +01:00
regmap-spmi.c regmap: add proper SPDX identifiers on files that did not have them. 2019-04-25 20:22:15 +01:00
regmap-w1.c regmap: regmap-w1: Drop unreachable code 2019-11-19 13:09:20 +00:00
regmap.c regmap: Fix order of regmap write log 2020-11-12 16:05:17 +00:00
trace.h regmap: Remove duplicate type field from regmap regcache_sync trace event 2020-11-24 14:14:00 +00:00