summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaehee Yoo <ap420073@gmail.com>2022-05-23 16:17:08 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-14 18:44:53 +0200
commit4b8032d39b276c52db57ff834c300405b9da2691 (patch)
treecbfdf4f334700507c964fbf312e39e986fabfec4
parent5559f47604c69623fae85db994492b65a0ce9bcf (diff)
amt: fix possible memory leak in amt_rcv()
[ Upstream commit 1a1a0e80e005cbdc2c250fc858e1d8570f4e4acb ] If an amt receives packets and it finds socket. If it can't find a socket, it should free a received skb. But it doesn't. So, a memory leak would possibly occur. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/amt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index d376ed89f836c..22d7da749a240 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -2679,7 +2679,7 @@ static int amt_rcv(struct sock *sk, struct sk_buff *skb)
amt = rcu_dereference_sk_user_data(sk);
if (!amt) {
err = true;
- goto out;
+ goto drop;
}
skb->dev = amt->dev;