mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-08 21:54:57 +02:00
xt_psd: replace vzalloc by vmalloc+memset
The lower support boundary is currently 2.6.32, but vzalloc is only available since 2.6.37.
This commit is contained in:
@@ -138,15 +138,17 @@ static bool state6_alloc_mem(void)
|
|||||||
if (state6.hash != NULL)
|
if (state6.hash != NULL)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
state6.list = vzalloc(LIST_SIZE * sizeof(struct host6));
|
state6.list = vmalloc(LIST_SIZE * sizeof(struct host6));
|
||||||
if (state6.list == NULL)
|
if (state6.list == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
memset(state6.list, 0, LIST_SIZE * sizeof(struct host6));
|
||||||
|
|
||||||
state6.hash = vzalloc(HASH_SIZE * sizeof(struct host*));
|
state6.hash = vmalloc(HASH_SIZE * sizeof(struct host*));
|
||||||
if (state6.hash == NULL) {
|
if (state6.hash == NULL) {
|
||||||
vfree(state6.list);
|
vfree(state6.list);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
memset(state6.hash, 0, HASH_SIZE * sizeof(struct host *));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user