diff options
author | Liang He <windhl@126.com> | 2022-06-15 20:51:05 +0800 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2023-05-08 08:14:52 +0200 |
commit | 51cbbcd6469b2a32e222ec220039af20a16f2769 (patch) | |
tree | e7c5548a965ae06f94a4320cf2acff0f1c19475d /drivers/w1 | |
parent | ecaed1a26f7215f48420a9c02e229b84b5fbb882 (diff) | |
download | linux-stable-51cbbcd6469b2a32e222ec220039af20a16f2769.tar.gz linux-stable-51cbbcd6469b2a32e222ec220039af20a16f2769.tar.bz2 linux-stable-51cbbcd6469b2a32e222ec220039af20a16f2769.zip |
w1: Add missing of_node_put() in w1.c
In __w1_attach_slave_device, we really need not to use of_node_put
in normal path as the reference is escaped by sl. However, we need
of_node_put in the fail path before put_device.
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220615125105.3966317-1-windhl@126.com
[krzysztof: fix whitespace / checkpatch]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r-- | drivers/w1/w1.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index bc11cdd2e4f2..e16a60872226 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -692,6 +692,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl) dev_err(&sl->dev, "Device registration [%s] failed. err=%d\n", dev_name(&sl->dev), err); + of_node_put(sl->dev.of_node); put_device(&sl->dev); return err; } |