]> Git Repo - J-linux.git/commitdiff
w1: Add missing of_node_put() in w1.c
authorLiang He <[email protected]>
Wed, 15 Jun 2022 12:51:05 +0000 (20:51 +0800)
committerKrzysztof Kozlowski <[email protected]>
Mon, 8 May 2023 06:14:52 +0000 (08:14 +0200)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[krzysztof: fix whitespace / checkpatch]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
drivers/w1/w1.c

index bc11cdd2e4f239686ef7303f2402083bdea35264..e16a60872226dfe8bd0ff9e350122e6a1335980e 100644 (file)
@@ -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;
        }
This page took 0.068485 seconds and 4 git commands to generate.