From b2299b6c5978a12ea06df1c6a66d64179ca68f5e Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 27 Apr 2011 21:01:22 +0200 Subject: [PATCH] compat: handle fail of vmalloc() Only memset the memory if we get a valid pointer. Signed-off-by: Hauke Mehrtens --- compat/compat-2.6.37.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.30.2