[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4BEA3FF3CAA35E408EA55C7BE2E61D0549647A169D@xmail3.se.axis.com>
Date: Tue, 18 May 2010 11:02:52 +0200
From: Mikael Starvik <mikael.starvik@...s.com>
To: Steven Liu <lingjiujianke@...il.com>,
Jesper Nilsson <Jesper.Nilsson@...s.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-cris-kernel <linux-cris-kernel@...s.com>,
"liuqi@...nderst.com" <liuqi@...nderst.com>
Subject: RE: [PATCH] cris:Check kmalloc return value before use data
Sure, if you feel like its worth it. If we can't allocate one page of data in an init function we are probably up for more problems soon...
Signed-off-by: Mikael Starvik <starvik@...s.com>
-----Original Message-----
From: Steven Liu [mailto:lingjiujianke@...il.com]
Sent: den 18 maj 2010 08:26
To: Mikael Starvik; Jesper Nilsson; linux-kernel@...r.kernel.org; linux-cris-kernel; liuqi@...nderst.com
Subject: [PATCH] cris:Check kmalloc return value before use data
Check kmalloc return value before use data
Signed-off-by: Liu Qi <lingjiujianke@...il.com>
---
arch/cris/arch-v32/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/cris/arch-v32/kernel/signal.c
b/arch/cris/arch-v32/kernel/signal.c
index 0b7e3f1..dd69fb4 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -656,6 +656,9 @@ int __init
cris_init_signal(void)
{
u16* data = kmalloc(PAGE_SIZE, GFP_KERNEL);
+ if(!data){
+ printk(KERN_ERR "kmalloc memory failed in %s \n", __func__);
+ return -ENOMEM;
+ }
/* This is movu.w __NR_sigreturn, r9; break 13; */
data[0] = 0x9c5f;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists