Re: [PATCH] mtd: mtdoops: free page bitmap when the backing MTD is removed

Miquel Raynal <[email protected]>
Newsgroups org.infradead.lists.linux-mtd,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <[email protected]>
On Mon, 13 Jul 2026 13:22:03 +0800, raoxu wrote:
> 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.
> 
> [...]

Applied to mtd/next, thanks!

[1/1] mtd: mtdoops: free page bitmap when the backing MTD is removed
      commit: 956e7da12c114f13c63d126ab1d79c3b6a819060

Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).

Kind regards,
Miquèl


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.