summaryrefslogtreecommitdiff
path: root/drivers/net/amt.c
diff options
context:
space:
mode:
authorTaehee Yoo <ap420073@gmail.com>2022-05-19 06:15:55 +0300
committerJakub Kicinski <kuba@kernel.org>2022-05-21 03:08:08 +0300
commitfe29794c3585d039fefebaa2b5a4932a627ad4fd (patch)
tree6f367f105bd9a3d2a5f6ffca21bf52739580a12a /drivers/net/amt.c
parent937956ba404e70a765ca5aa39d3d7564d86a8872 (diff)
downloadlinux-fe29794c3585d039fefebaa2b5a4932a627ad4fd.tar.xz
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: 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.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 2b4ce3869f08..de4ea518c793 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");