From: Neil P. Murphy Date: Mon, 19 Oct 2015 05:34:54 +0000 (-0400) Subject: xt_ACCOUNT: call free_pages(x,2) X-Git-Tag: v2.10~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f89f10bbe99fcb87646f20ad3345401ee0a67f65;p=thirdparty%2Fxtables-addons.git xt_ACCOUNT: call free_pages(x,2) Below is the patch with the *rest* of the free_page(X) calls changed to free_pages(X, 2). xt_ACCOUNT should always allocate memory in page pairs. And always *free* memory in page pairs. References: http://www.spinics.net/lists/netfilter-devel/msg39025.html --- diff --git a/extensions/ACCOUNT/xt_ACCOUNT.c b/extensions/ACCOUNT/xt_ACCOUNT.c index 85e73ed..200fdb3 100644 --- a/extensions/ACCOUNT/xt_ACCOUNT.c +++ b/extensions/ACCOUNT/xt_ACCOUNT.c @@ -141,7 +141,7 @@ static void ipt_acc_data_free(void *data, uint8_t depth) unsigned int b; for (b = 0; b <= 255; b++) { if (mask_16->mask_24[b]) { - free_page((unsigned long)mask_16->mask_24[b]); + free_pages((unsigned long)mask_16->mask_24[b], 2); } } free_pages((unsigned long)data, 2); @@ -158,10 +158,10 @@ static void ipt_acc_data_free(void *data, uint8_t depth) for (b = 0; b <= 255; b++) { if (mask_16->mask_24[b]) { - free_page((unsigned long)mask_16->mask_24[b]); + free_pages((unsigned long)mask_16->mask_24[b], 2); } } - free_page((unsigned long)mask_16); + free_pages((unsigned long)mask_16, 2); } } free_pages((unsigned long)data, 2);