Search Linux Wireless

[PATCH] compat: handle fail of vmalloc()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Only memset the memory if we get a valid pointer.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 compat/compat-2.6.37.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/compat/compat-2.6.37.c b/compat/compat-2.6.37.c
index c49efea..8698e1d 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);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux