[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_E1A26771CDAB389A0396D1681A90A49E5D09@qq.com>
Date: Wed, 9 Jul 2025 03:52:51 +0000
From: veritas501@...mail.com
To: davem@...emloft.net
Cc: Kito Xu <veritas501@...mail.com>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2] net: appletalk: Fix device refcount leak in atrtr_create()
From: Kito Xu <veritas501@...mail.com>
When updating an existing route entry in atrtr_create(), the old device
reference was not being released before assigning the new device,
leading to a device refcount leak. Fix this by calling dev_put() to
release the old device reference before holding the new one.
Fixes: c7f905f0f6d4 ("[ATALK]: Add missing dev_hold() to atrtr_create().")
Signed-off-by: Kito Xu <veritas501@...mail.com>
---
net/appletalk/ddp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 73ea7e67f05a..30242fe10341 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -576,6 +576,7 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint)
/* Fill in the routing entry */
rt->target = ta->sat_addr;
+ dev_put(rt->dev); /* Release old device */
dev_hold(devhint);
rt->dev = devhint;
rt->flags = r->rt_flags;
--
2.34.1
Powered by blists - more mailing lists