]> git.ipfire.org Git - thirdparty/linux.git/commit
w1: fix redundant counter decrement in w1_attach_slave_device()
authorHaoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Thu, 18 Dec 2025 11:14:14 +0000 (19:14 +0800)
committerKrzysztof Kozlowski <krzk@kernel.org>
Sun, 28 Dec 2025 10:52:10 +0000 (11:52 +0100)
commitcc8f92e41eb76f450f05234fef2054afc3633100
tree7a711e377624671a5c90bfaec78e14a0c1cd027d
parent761fcf46a1bd797bd32d23f3ea0141ffd437668a
w1: fix redundant counter decrement in w1_attach_slave_device()

In w1_attach_slave_device(), if __w1_attach_slave_device() fails,
put_device() -> w1_slave_release() is called to do the cleanup job.
In w1_slave_release(), sl->family->refcnt and sl->master->slave_count
have already been decremented. There is no need to decrement twice
in w1_attach_slave_device().

Fixes: 2c927c0c73fd ("w1: Fix slave count on 1-Wire bus (resend)")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Link: https://patch.msgid.link/20251218111414.564403-1-lihaoxiang@isrc.iscas.ac.cn
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
drivers/w1/w1.c