Skip to content

Commit 711c80f

Browse files
veritas501kuba-moo
authored andcommitted
net: appletalk: Fix device refcount leak in atrtr_create()
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]>
1 parent 7ac5cc2 commit 711c80f

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
@@ -576,6 +576,7 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint)
576576

577577
/* Fill in the routing entry */
578578
rt->target = ta->sat_addr;
579+
dev_put(rt->dev); /* Release old device */
579580
dev_hold(devhint);
580581
rt->dev = devhint;
581582
rt->flags = r->rt_flags;

0 commit comments

Comments
 (0)