Skip to content

Commit d2e9f50

Browse files
veritas501gregkh
authored andcommitted
net: appletalk: Fix device refcount leak in atrtr_create()
[ Upstream commit 711c80f7d8b163d3ecd463cd96f07230f488e750 ] 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: c7f905f ("[ATALK]: Add missing dev_hold() to atrtr_create().") Signed-off-by: Kito Xu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent eed8960 commit d2e9f50

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/appletalk/ddp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint)
563563

564564
/* Fill in the routing entry */
565565
rt->target = ta->sat_addr;
566+
dev_put(rt->dev); /* Release old device */
566567
dev_hold(devhint);
567568
rt->dev = devhint;
568569
rt->flags = r->rt_flags;

0 commit comments

Comments
 (0)