summaryrefslogtreecommitdiff
path: root/net/xfrm
diff options
context:
space:
mode:
authorHuang Zijiang <huang.zijiang@zte.com.cn>2020-02-12 12:54:36 +0300
committerSteffen Klassert <steffen.klassert@secunet.com>2020-02-19 11:33:56 +0300
commita4c278d1bee1e2add3f12705401c1c5e6470f291 (patch)
tree96fb3df8a92b2a571cac8abd15d8b3b865581f17 /net/xfrm
parent92df9f8a745ee9b8cc250514272345cb2e74e7ef (diff)
downloadlinux-a4c278d1bee1e2add3f12705401c1c5e6470f291.tar.xz
xfrm: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
Use kmem_cache_zalloc instead of manually setting kmem_cache_alloc with flag GFP_ZERO since kzalloc sets allocated memory to zero. Change in v2: add indation Signed-off-by: Huang Zijiang <huang.zijiang@zte.com.cn> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 170d6e7f31d3..8be2d926acc2 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -612,7 +612,7 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
{
struct xfrm_state *x;
- x = kmem_cache_alloc(xfrm_state_cache, GFP_ATOMIC | __GFP_ZERO);
+ x = kmem_cache_zalloc(xfrm_state_cache, GFP_ATOMIC);
if (x) {
write_pnet(&x->xs_net, net);