mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
net: appletalk: Fix device refcount leak in atrtr_create()
[ Upstream commit711c80f7d8
] 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:c7f905f0f6
("[ATALK]: Add missing dev_hold() to atrtr_create().") Signed-off-by: Kito Xu <veritas501@foxmail.com> Link: https://patch.msgid.link/tencent_E1A26771CDAB389A0396D1681A90A49E5D09@qq.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
12b00ec996
commit
a7852b0179
|
@ -563,6 +563,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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user