summaryrefslogtreecommitdiff
path: root/drivers/net/amt.c
diff options
context:
space:
mode:
authorTaehee Yoo <ap420073@gmail.com>2022-05-23 16:17:08 +0000
committerJakub Kicinski <kuba@kernel.org>2022-05-25 21:36:16 -0700
commit1a1a0e80e005cbdc2c250fc858e1d8570f4e4acb (patch)
treebe36a6ae8030157e48a946e6363217a83b7406eb /drivers/net/amt.c
parentac1dbf55981b88d64312858ea06e3e63001f085d (diff)
amt: fix possible memory leak in amt_rcv()
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>
Diffstat (limited to 'drivers/net/amt.c')
-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 635de07b2e40..ebee5f07a208 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;