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>
Wed, 23 Jan 2019 07:09:49 +0000 (08:09 +0100)
commit96188b18861a78efb40d390931cbe8d938d6a3cb
treec8b3d422ac9f0c502d637ea675667884722ef170
parent71a41c7d322f72d6cecc972ae1e112dae8790470
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