projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62b49c9
)
net/netfilter/x_tables.c: use kvmalloc() in xt_alloc_table_info()
author
Michal Hocko
<
[email protected]
>
Wed, 12 Jul 2017 21:35:37 +0000
(14:35 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 12 Jul 2017 23:26:02 +0000
(16:26 -0700)
xt_alloc_table_info() basically opencodes kvmalloc() so use the library
function instead.
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Michal Hocko <
[email protected]
>
Cc: Pablo Neira Ayuso <
[email protected]
>
Cc: Jozsef Kadlecsik <
[email protected]
>
Cc: Florian Westphal <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
net/netfilter/x_tables.c
patch
|
blob
|
history
diff --git
a/net/netfilter/x_tables.c
b/net/netfilter/x_tables.c
index 1770c1d9b37fc14be9d9d8cf4721d21c745826ad..e1648238a9c99d234d77ab1711d18db9d49926bd 100644
(file)
--- a/
net/netfilter/x_tables.c
+++ b/
net/netfilter/x_tables.c
@@
-1003,14
+1003,10
@@
struct xt_table_info *xt_alloc_table_info(unsigned int size)
if ((SMP_ALIGN(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, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY,
- PAGE_KERNEL);
- if (!info)
- return NULL;
- }
+ info = kvmalloc(sz, GFP_KERNEL);
+ if (!info)
+ return NULL;
+
memset(info, 0, sizeof(*info));
info->size = size;
return info;