Commit 1a1a0e80 authored by Taehee Yoo's avatar Taehee Yoo Committed by Jakub Kicinski
Browse files

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: cbc21dc1 ("amt: add data plane of amt interface")
Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ac1dbf55
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;