Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] MT-VPE : Fix the usage of kmalloc
@ 2008-03-13  5:38 tiejun.chen
  2008-03-13 15:15 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: tiejun.chen @ 2008-03-13  5:38 UTC (permalink / raw)
  To: linux-mips

The return value of kmalloc() should be check, otherwise it is potential
risk.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
 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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-13 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-13  5:38 [PATCH] MT-VPE : Fix the usage of kmalloc tiejun.chen
2008-03-13 15:15 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox