pstore/ram: Fix error-path memory leak in persistent_ram_new() callers
authorKees Cook <keescook@chromium.org>
Mon, 30 Dec 2019 19:48:10 +0000 (11:48 -0800)
committerKees Cook <keescook@chromium.org>
Thu, 2 Jan 2020 20:30:39 +0000 (12:30 -0800)
commit8df955a32a73315055e0cd187cbb1cea5820394b
tree51a54cdb8074c25a8a5aca178624e0542d649f7a
parentd1eef1c619749b2a57e514a3fa67d9a516ffa919
pstore/ram: Fix error-path memory leak in persistent_ram_new() callers

For callers that allocated a label for persistent_ram_new(), if the call
fails, they must clean up the allocation.

Suggested-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Fixes: 1227daa43bce ("pstore/ram: Clarify resource reservation labels")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/lkml/20191211191353.14385-1-navid.emamdoost@gmail.com
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/ram.c