]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: virt-concat: free duplicate generated name
authorXu Rao <raoxu@uniontech.com>
Fri, 26 Jun 2026 02:13:38 +0000 (10:13 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 3 Jul 2026 13:45:07 +0000 (15:45 +0200)
commitcaa0ecbeff4f7fbf70f22bd8ca598918bffb1b78
tree00983245bc8bdb07b1d08890cf5f9cef0a6c15d8
parent16f7ec8d5dc100eafd2c8e06cd30340a30b104a1
mtd: virt-concat: free duplicate generated name

Every MTD registration runs mtd_virt_concat_create_join().  Once a
virtual concat has already been registered, the function builds the same
name again and takes the equal-name branch.  That branch skips to the
next item without freeing the newly allocated string.

Free the temporary name before continuing.

Fixes: 43db6366fc2d ("mtd: Add driver for concatenating devices")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/mtd_virt_concat.c