Re: [PATCH] mtd: phram: fix name leak when phram_setup() fails
From: Miquel Raynal
Date: Tue Nov 17 2026 - 08:37:21 EST
On Sun, 18 Oct 2026 00:57:33 +0100, Palla Raghunath wrote:
> parse_err() is a macro that prints the message and then does "return 1".
> phram_setup() still uses it after parse_name() has allocated the device
> name, with a "goto error" right after each call. That goto is never
> reached, so the kfree(name) under the error label never runs and the
> name leaks every time one of these checks fails.
>
> syzbot hit this by writing "p0,0x8000000000000000,0" to
> /sys/module/phram/parameters/phram. The zero length fails the
> erasesize/len check and the "p0" string is leaked.
>
> [...]
Applied to mtd/next, thanks!
[1/1] mtd: phram: fix name leak when phram_setup() fails
commit: 705a7ed4cc921060854da406a803d688c8aaa52c
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