pstore/ram: Avoid allocation and leak of platform data
authorKees Cook <keescook@chromium.org>
Sun, 20 Jan 2019 22:33:34 +0000 (14:33 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 20:40:34 +0000 (21:40 +0100)
commit483ac8e65a8a645d0ba31ab7077ac50debeb4127
tree6e62a2dc6f354f224621a9b7101eced7c9c01165
parenta10cabbf7a7615ab1d868780f15a64b732ea360e
pstore/ram: Avoid allocation and leak of platform data

commit 5631e8576a3caf606cdc375f97425a67983b420c upstream.

Yue Hu noticed that when parsing device tree the allocated platform data
was never freed. Since it's not used beyond the function scope, this
switches to using a stack variable instead.

Reported-by: Yue Hu <huyue2@yulong.com>
Fixes: 35da60941e44 ("pstore/ram: add Device Tree bindings")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/pstore/ram.c