diff --git a/core/rtw_debug.c b/core/rtw_debug.c index a58c947..d4e5bd7 100755 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -1052,26 +1052,6 @@ int proc_get_all_sta_info(char *page, char **start, #endif -#ifdef DBG_MEMORY_LEAK -#include -extern atomic_t _malloc_cnt;; -extern atomic_t _malloc_size;; - -int proc_get_malloc_cnt(char *page, char **start, - off_t offset, int count, - int *eof, void *data) -{ - - int len = 0; - - len += snprintf(page + len, count - len, "_malloc_cnt=%d\n", atomic_read(&_malloc_cnt)); - len += snprintf(page + len, count - len, "_malloc_size=%d\n", atomic_read(&_malloc_size)); - - *eof = 1; - return len; -} -#endif /* DBG_MEMORY_LEAK */ - #ifdef CONFIG_FIND_BEST_CHANNEL int proc_get_best_channel(char *page, char **start, off_t offset, int count, diff --git a/include/autoconf.h b/include/autoconf.h index bc8c272..da74abf 100755 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -381,8 +381,6 @@ //#define DBG_HAL_INIT_PROFILING -//#define DBG_MEMORY_LEAK - //TX use 1 urb //#define CONFIG_SINGLE_XMIT_BUF //RX use 1 urb diff --git a/include/rtw_debug.h b/include/rtw_debug.h index 58fcbe5..adf6b31 100755 --- a/include/rtw_debug.h +++ b/include/rtw_debug.h @@ -373,12 +373,6 @@ extern u32 GlobalDebugLevel; #endif -#ifdef DBG_MEMORY_LEAK - int proc_get_malloc_cnt(char *page, char **start, - off_t offset, int count, - int *eof, void *data); -#endif - #ifdef CONFIG_FIND_BEST_CHANNEL int proc_get_best_channel(char *page, char **start, off_t offset, int count, diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 3b6ee06..cd21a71 100755 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -35,12 +35,6 @@ #define RT_TAG '1178' -#ifdef DBG_MEMORY_LEAK -#include -atomic_t _malloc_cnt = ATOMIC_INIT(0); -atomic_t _malloc_size = ATOMIC_INIT(0); -#endif /* DBG_MEMORY_LEAK */ - /* * Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE * @return: one of RTW_STATUS_CODE @@ -83,13 +77,6 @@ inline u8* _rtw_vmalloc(u32 sz) { u8 *pbuf; pbuf = vmalloc(sz); -#ifdef DBG_MEMORY_LEAK - if ( pbuf != NULL) { - atomic_inc(&_malloc_cnt); - atomic_add(sz, &_malloc_size); - } -#endif /* DBG_MEMORY_LEAK */ - return pbuf; } @@ -105,10 +92,6 @@ inline u8* _rtw_zvmalloc(u32 sz) inline void _rtw_vmfree(u8 *pbuf, u32 sz) { vfree(pbuf); -#ifdef DBG_MEMORY_LEAK - atomic_dec(&_malloc_cnt); - atomic_sub(sz, &_malloc_size); -#endif /* DBG_MEMORY_LEAK */ } u8* _rtw_malloc(u32 sz) @@ -123,15 +106,7 @@ u8* _rtw_malloc(u32 sz) #endif pbuf = kmalloc(sz,in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); -#ifdef DBG_MEMORY_LEAK - if ( pbuf != NULL) { - atomic_inc(&_malloc_cnt); - atomic_add(sz, &_malloc_size); - } -#endif /* DBG_MEMORY_LEAK */ - return pbuf; - } @@ -156,11 +131,6 @@ void _rtw_mfree(u8 *pbuf, u32 sz) else #endif kfree(pbuf); -#ifdef DBG_MEMORY_LEAK - atomic_dec(&_malloc_cnt); - atomic_sub(sz, &_malloc_size); -#endif /* DBG_MEMORY_LEAK */ - } inline struct sk_buff *_rtw_skb_alloc(u32 sz)