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

Commit f18e1cdf authored by Michal Hocko's avatar Michal Hocko Committed by Subash Abhinov Kasiviswanathan
Browse files

netfilter: x_tables: remove size check

Back in 2002 vmalloc used to BUG on too large sizes.  We are much better
behaved these days and vmalloc simply returns NULL for those.  Remove the
check as it simply not needed and the comment is even misleading.

CRs-Fixed: 2303751
Change-Id: I434053510012b9e8efc2732a67820aa3d8fc52be
Link: http://lkml.kernel.org/r/20180131081916.GO21609@dhcp22.suse.cz


Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMichal Hocko <mhocko@suse.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Florian Westphal <fw@strlen.de>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Git-commit: fd2c19b2
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 9e9fe7fd
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1050,10 +1050,6 @@ 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