From: Taehee Yoo Date: Thu, 19 May 2022 03:15:55 +0000 (+0000) Subject: amt: fix memory leak for advertisement message X-Git-Tag: v5.17.14~340 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=19bb2d57eac86a368839a92117d8a10ab7183623;p=wrapfs-5.17.y.git amt: fix memory leak for advertisement message [ Upstream commit fe29794c3585d039fefebaa2b5a4932a627ad4fd ] 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: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- diff --git a/drivers/net/amt.c b/drivers/net/amt.c index 96a2f6a505c3..fb774d568baa 100644 --- a/drivers/net/amt.c +++ b/drivers/net/amt.c @@ -2698,9 +2698,8 @@ static int amt_rcv(struct sock *sk, struct sk_buff *skb) err = true; goto drop; } - if (amt_advertisement_handler(amt, skb)) - amt->dev->stats.rx_dropped++; - goto out; + err = amt_advertisement_handler(amt, skb); + break; case AMT_MSG_MULTICAST_DATA: if (iph->saddr != amt->remote_ip) { netdev_dbg(amt->dev, "Invalid Relay IP\n");