MIPS: VPE loader: Check vmalloc return value in vpe_open
authorJesper Juhl <jj@chaosbits.net>
Sat, 30 Oct 2010 16:37:16 +0000 (18:37 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 16 Dec 2010 18:10:54 +0000 (18:10 +0000)
commit863abad4f644b6c12bc8176206b35fa7e7cfe1a9
treecf6aacba2461f8d59b81bb03ca345f0d2270db39
parentd62c9ced7ca783e64ff4d9d3d1340cfe2284d47b
MIPS: VPE loader: Check vmalloc return value in vpe_open

The return value of the vmalloc() call in arch/mips/kernel/vpe.c::vpe_open()
is not checked, so we potentially store a null pointer in v->pbuffer.  Add
a check for a null return and then return -ENOMEM in that case.

[Ralf: The check added by Jesper's original patch is where it logically
should be.  Adding it eleminated the need for the checks in a few other
places, so I removed them.  There still is a zillion of other things that
need to be fixed in this file / API.]

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/1747/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/vpe.c