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

Commit 78204b52 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "netfilter: x_tables: do not fail xt_alloc_table_info too easilly"

parents 61ea00fb 0540b251
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -1050,16 +1050,7 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size)
	if (sz < sizeof(*info) || sz >= XT_MAX_TABLE_SIZE)
		return NULL;

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

	/* __GFP_NORETRY is not fully supported by kvmalloc but it should
	 * work reasonably well if sz is too large and bail out rather
	 * than shoot all processes down before realizing there is nothing
	 * more to reclaim.
	 */
	info = kvmalloc(sz, GFP_KERNEL | __GFP_NORETRY);
	info = kvmalloc(sz, GFP_KERNEL_ACCOUNT);
	if (!info)
		return NULL;