From 218abe13a66516d163b2be5c2094149afa8cce5a Mon Sep 17 00:00:00 2001 From: mentor Date: Thu, 24 Apr 2008 13:51:22 +0000 Subject: [PATCH] Add kzalloc() compatibility function git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3571 0192ed92-7a03-0410-a25b-9323aeb14dbd --- include/compat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/compat.h b/include/compat.h index 2aafc7d..a9bf736 100644 --- a/include/compat.h +++ b/include/compat.h @@ -56,6 +56,16 @@ #define __force #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3) +static inline void *kzalloc(size_t size, gfp_t flags) +{ + void *p = kmalloc(size, flags); + if (likely(p)) + memset(p, 0, size); + return p; +} +#endif + #ifndef container_of #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ -- 2.35.1