From: Hauke Mehrtens Date: Wed, 27 Apr 2011 19:01:22 +0000 (+0200) Subject: compat: handle fail of vmalloc() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b2299b6c5978a12ea06df1c6a66d64179ca68f5e;p=openwrt%2Fstaging%2Fblogic.git compat: handle fail of vmalloc() Only memset the memory if we get a valid pointer. Signed-off-by: Hauke Mehrtens --- diff --git a/compat/compat-2.6.37.c b/compat/compat-2.6.37.c index c49efeaf26e1..8698e1dcbf0f 100644 --- a/compat/compat-2.6.37.c +++ b/compat/compat-2.6.37.c @@ -348,7 +348,8 @@ void *vzalloc(unsigned long size) { void *buf; buf = vmalloc(size); - memset(buf, 0, size); + if (buf) + memset(buf, 0, size); return buf; } EXPORT_SYMBOL(vzalloc);