]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_psd: replace vzalloc by vmalloc+memset
authorJan Engelhardt <jengelh@inai.de>
Mon, 15 Oct 2012 18:02:20 +0000 (20:02 +0200)
committerJan Engelhardt <jengelh@inai.de>
Mon, 15 Oct 2012 18:02:43 +0000 (20:02 +0200)
The lower support boundary is currently 2.6.32, but vzalloc is only
available since 2.6.37.

extensions/xt_psd.c

index 08ce508ec1bf397b649157b53d78cfe395ec1175..6cbe1860fc918013b0a85af08747484abfc53938 100644 (file)
@@ -138,15 +138,17 @@ static bool state6_alloc_mem(void)
        if (state6.hash != NULL)
                return true;
 
-       state6.list = vzalloc(LIST_SIZE * sizeof(struct host6));
+       state6.list = vmalloc(LIST_SIZE * sizeof(struct host6));
        if (state6.list == NULL)
                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) {
                vfree(state6.list);
                return false;
        }
+       memset(state6.hash, 0, HASH_SIZE * sizeof(struct host *));
        return true;
 }
 #endif