From: Taehee Yoo Date: Mon, 23 May 2022 16:17:08 +0000 (+0000) Subject: amt: fix possible memory leak in amt_rcv() X-Git-Tag: baikal/aarch64/sdk6.1~3836^2~53^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=fc88a4dae8ffc3718b549340bb4043388c4a7363;p=kernel.git 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: 19284cc854b3 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/amt.c b/drivers/net/amt.c index 635de07b2e406..ebee5f07a208e 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;