mirror of
https://github.com/aircrack-ng/rtl8188eus.git
synced 2026-04-20 18:08:55 +00:00
Remove wrappers around vmalloc()
This commit is contained in:
@@ -7880,7 +7880,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
|
||||
return -EFAULT;
|
||||
|
||||
len = dwrq->length;
|
||||
ext = rtw_vmalloc(len);
|
||||
ext = vmalloc(len);
|
||||
if (!ext)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -7892,7 +7892,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
|
||||
|
||||
|
||||
#ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV
|
||||
ext_dbg = rtw_vmalloc(len);
|
||||
ext_dbg = vmalloc(len);
|
||||
if (!ext_dbg) {
|
||||
rtw_vmfree(ext, len);
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -73,37 +73,11 @@ u32 rtw_atoi(u8 *s)
|
||||
|
||||
}
|
||||
|
||||
inline void *_rtw_vmalloc(u32 sz)
|
||||
{
|
||||
void *pbuf;
|
||||
#ifdef PLATFORM_LINUX
|
||||
pbuf = vmalloc(sz);
|
||||
#endif
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
pbuf = malloc(sz, M_DEVBUF, M_NOWAIT);
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
NdisAllocateMemoryWithTag(&pbuf, sz, RT_TAG);
|
||||
#endif
|
||||
|
||||
#ifdef DBG_MEMORY_LEAK
|
||||
#ifdef PLATFORM_LINUX
|
||||
if (pbuf != NULL) {
|
||||
atomic_inc(&_malloc_cnt);
|
||||
atomic_add(sz, &_malloc_size);
|
||||
}
|
||||
#endif
|
||||
#endif /* DBG_MEMORY_LEAK */
|
||||
|
||||
return pbuf;
|
||||
}
|
||||
|
||||
inline void *_rtw_zvmalloc(u32 sz)
|
||||
{
|
||||
void *pbuf;
|
||||
#ifdef PLATFORM_LINUX
|
||||
pbuf = _rtw_vmalloc(sz);
|
||||
pbuf = vmalloc(sz);
|
||||
if (pbuf != NULL)
|
||||
memset(pbuf, 0, sz);
|
||||
#endif
|
||||
@@ -575,7 +549,7 @@ inline void *dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func,
|
||||
if (match_mstat_sniff_rules(flags, sz))
|
||||
RTW_INFO("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
|
||||
|
||||
p = _rtw_vmalloc((sz));
|
||||
p = vmalloc((sz));
|
||||
|
||||
rtw_mstat_update(
|
||||
flags
|
||||
|
||||
Reference in New Issue
Block a user