The return value of kmalloc() should be check, otherwise it is potential risk. Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxxxxxx> --- vpe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index c06eb81..35767de 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c @@ -885,6 +885,10 @@ static int vpe_elfload(struct vpe * v) } v->load_addr = alloc_progmem(mod.core_size); +#ifndef CONFIG_MIPS_VPE_LOADER_TOM + if (!(v->load_addr)) + return -ENOMEM; +#endif memset(v->load_addr, 0, mod.core_size); printk("VPE loader: loading to %p\n", v->load_addr);