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

amt: fix memory leak for advertisement message



When a gateway receives an advertisement message, it extracts relay
information and then it should be freed.
But the advertisement handler doesn't free it.
So, memory leak would 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 937956ba
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -2698,9 +2698,8 @@ static int amt_rcv(struct sock *sk, struct sk_buff *skb)
				err = true;
				err = true;
				goto drop;
				goto drop;
			}
			}
			if (amt_advertisement_handler(amt, skb))
			err = amt_advertisement_handler(amt, skb);
				amt->dev->stats.rx_dropped++;
			break;
			goto out;
		case AMT_MSG_MULTICAST_DATA:
		case AMT_MSG_MULTICAST_DATA:
			if (iph->saddr != amt->remote_ip) {
			if (iph->saddr != amt->remote_ip) {
				netdev_dbg(amt->dev, "Invalid Relay IP\n");
				netdev_dbg(amt->dev, "Invalid Relay IP\n");