[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1542783468-67482-1-git-send-email-bianpan2016@163.com>
Date: Wed, 21 Nov 2018 14:57:48 +0800
From: Pan Bian <bianpan2016@....com>
To: Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Pan Bian <bianpan2013@....com>
Subject: [net] xfrm_user: use xfrm_state_put to free xfrm_state_alloc return value
From: Pan Bian <bianpan2013@....com>
The memory chunk allocated by xfrm_state_alloc() should be released with
xfrm_state_put(), not kfree.
Signed-off-by: Pan Bian <bianpan2013@....com>
---
net/xfrm/xfrm_user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index c9a84e2..267922c 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2288,13 +2288,13 @@ static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh,
}
- kfree(x);
+ xfrm_state_put(x);
kfree(xp);
return 0;
free_state:
- kfree(x);
+ xfrm_state_put(x);
nomem:
return err;
}
--
2.7.4
Powered by blists - more mailing lists