]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_ACCOUNT: call free_pages(x,2)
authorNeil P. Murphy <neal.p.murphy@alum.wpi.edu>
Mon, 19 Oct 2015 05:34:54 +0000 (01:34 -0400)
committerJan Engelhardt <jengelh@inai.de>
Mon, 9 Nov 2015 21:25:16 +0000 (22:25 +0100)
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

extensions/ACCOUNT/xt_ACCOUNT.c

index 85e73ed2379666c5fac5db1b490adfe0ad632f98..200fdb3569cdf6d52567671bd0d19c4c6f1e1025 100644 (file)
@@ -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);