Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5a8825c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "netfilter: x_tables: remove size check"

parents 1892b280 b07d364a
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -987,14 +987,12 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size)
	if (sz < sizeof(*info))
		return NULL;

	/* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */
	if ((size >> PAGE_SHIFT) + 2 > totalram_pages)
		return NULL;

	if (sz <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER))
		info = kmalloc(sz, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY);
	if (!info) {
		info = vmalloc(sz);
		info = __vmalloc(sz, GFP_KERNEL | __GFP_NOWARN |
				     __GFP_NORETRY | __GFP_HIGHMEM,
				 PAGE_KERNEL);
		if (!info)
			return NULL;
	}