Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mtd: phram: fix a double free issue in error path
commit 49c64df upstream. The variable 'name' is released multiple times in the error path, which may cause double free issues. This problem is avoided by adding a goto label to release the memory uniformly. And this change also makes the code a bit more cleaner. Fixes: 4f678a5 ("mtd: fix memory leaks in phram_setup") Signed-off-by: Wen Yang <[email protected]> Cc: Joern Engel <[email protected]> Cc: Miquel Raynal <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Vignesh Raghavendra <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information