pstore/ram: Fix error handling during przs allocation
authorAnton Vorontsov <anton.vorontsov@linaro.org>
Tue, 19 Jun 2012 02:15:51 +0000 (19:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2012 23:15:22 +0000 (16:15 -0700)
commit90b58d96907e0a45555429c0d3a79c85cea4b9fc
treead2a80bf0c8648493c62822eb140b38db7d1c238
parent924d37118f9e18825294b2012a10c6245d6c25e1
pstore/ram: Fix error handling during przs allocation

persistent_ram_new() returns ERR_PTR() value on errors, so during
freeing of the przs we should check for both NULL and IS_ERR() entries,
otherwise bad things will happen.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/pstore/ram.c