]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: appletalk: Fix device refcount leak in atrtr_create()
authorKito Xu <veritas501@foxmail.com>
Wed, 9 Jul 2025 03:52:51 +0000 (03:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:27:58 +0000 (18:27 +0200)
commita7852b01793669248dce0348d14df89e77a32afd
tree52db47723967d6fc6b0f2642f8fe7f5e135fc998
parent12b00ec99624f8da8c325f2dd6e807df26df0025
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: c7f905f0f6d4 ("[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>
net/appletalk/ddp.c