diff options
| author | Xu Rao <raoxu@uniontech.com> | 2026-07-13 13:22:03 +0800 |
|---|---|---|
| committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2026-07-17 17:49:27 +0200 |
| commit | 956e7da12c114f13c63d126ab1d79c3b6a819060 (patch) | |
| tree | b730bb47f5f2824fa3072e21dce159991f58ac2b /scripts/objdiff | |
| parent | 779aa4c66a96bf43d2d62982ea1a9096a9128d87 (diff) | |
| download | linux-956e7da12c114f13c63d126ab1d79c3b6a819060.tar.gz linux-956e7da12c114f13c63d126ab1d79c3b6a819060.zip | |
mtd: mtdoops: free page bitmap when the backing MTD is removed
mtdoops_notify_add() allocates oops_page_used when the configured MTD
device is registered. mtdoops_notify_remove() detaches from that device
but leaves the bitmap allocated. If the same MTD device is later
registered again, the add path allocates a new bitmap and overwrites the
old pointer, leaking one vmalloc allocation per remove/add cycle.
This is only visible when the backing MTD device can disappear and be
registered again while mtdoops remains loaded, so the usual static MTD
case does not expose it.
Free the bitmap after unregistering the dumper and flushing the pending
workers, then clear the pointer and page count before a later attach can
allocate fresh state. Clearing the pointer also keeps the module exit
path from freeing the same bitmap a second time after a remove event.
Fixes: be95745f0167 ("mtd: mtdoops: keep track of used/unused pages in an array")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
