linux-stable/drivers/mtd/spi-nor
Greg Kroah-Hartman b1524d5e4b mtd: spi-nor: fix memory leak when using debugfs_lookup()
[ Upstream commit ec738ca127 ]

When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time.  To solve this, remove the
lookup and create the directory on the first device found, and then
remove it when the module is unloaded.

Cc: Tudor Ambarus <tudor.ambarus@microchip.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Cc: linux-mtd@lists.infradead.org
Reviewed-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20230208160230.2179905-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-26 14:30:01 +02:00
..
controllers mtd: spi-nor: s/addr_width/addr_nbytes 2022-07-28 05:11:56 +03:00
atmel.c mtd: spi-nor: atmel: unify function names 2022-02-25 09:44:31 +02:00
catalyst.c mtd: spi-nor: catalyst: unify function names 2022-02-25 09:44:31 +02:00
core.c mtd: spi-nor: fix memory leak when using debugfs_lookup() 2023-04-26 14:30:01 +02:00
core.h mtd: spi-nor: fix memory leak when using debugfs_lookup() 2023-04-26 14:30:01 +02:00
debugfs.c mtd: spi-nor: fix memory leak when using debugfs_lookup() 2023-04-26 14:30:01 +02:00
eon.c mtd: spi-nor: support eon en25qh256a variant 2022-05-09 16:58:24 +05:30
esmt.c mtd: spi-nor: esmt: Use correct name of f25l32qa 2022-07-19 13:05:31 +03:00
everspin.c mtd: spi-nor: everspin: unify function names 2022-02-25 09:44:31 +02:00
fujitsu.c mtd: spi-nor: fujitsu: unify function names 2022-02-25 09:44:31 +02:00
gigadevice.c mtd: spi-nor: gigadevice: gd25q256: replace gd25q256_default_init with gd25q256_post_bfpt 2022-11-21 16:27:10 +02:00
intel.c mtd: spi-nor: intel: unify function names 2022-02-25 09:44:31 +02:00
issi.c mtd: spi-nor: add SFDP fixups for Quad Page Program 2022-11-22 08:19:01 +02:00
Kconfig mtd: spi-nor: keep lock bits if they are non-volatile 2020-12-07 23:01:15 +05:30
macronix.c mtd: spi-nor: macronix: unify function names 2022-02-25 09:44:31 +02:00
Makefile mtd: spi-nor: expose internal parameters via debugfs 2022-05-09 16:55:22 +05:30
micron-st.c mtd: spi-nor: micron-st: Enable locking for mt25qu256a 2022-11-21 17:10:08 +02:00
otp.c mtd: spi-nor: s/addr_width/addr_nbytes 2022-07-28 05:11:56 +03:00
sfdp.c mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type 2023-03-10 09:29:43 +01:00
sfdp.h mtd: spi-nor: move function declaration out of sfdp.h 2022-11-21 15:37:16 +02:00
spansion.c mtd: spi-nor: spansion: Consider reserved bits in CFR5 register 2023-03-10 09:29:42 +01:00
sst.c mtd: spi-nor: sst: unify function names 2022-02-25 09:44:32 +02:00
swp.c mtd: spi-nor: Introduce spi_nor_set_mtd_info() 2021-12-07 17:05:10 +02:00
sysfs.c mtd: spi-nor: sysfs: print JEDEC ID for generic flash driver 2022-11-21 15:37:16 +02:00
winbond.c mtd: spi-nor: winbond: add support for W25Q512NW-IQ 2022-11-21 17:18:44 +02:00
xilinx.c mtd: spi-nor: s/addr_width/addr_nbytes 2022-07-28 05:11:56 +03:00
xmc.c mtd: spi-nor: xmc: unify function names 2022-02-25 09:44:32 +02:00