coresight: platform: Fix refcounting for graph nodes
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Thu, 20 Sep 2018 19:17:38 +0000 (13:17 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Sep 2018 18:09:17 +0000 (20:09 +0200)
The coresight driver doesn't drop the references on the
remote endpoint/port nodes. Add the missing of_node_put()
calls.

Reported-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/of_coresight.c

index 70205f3eae8e70677c419bdd5fdb0d73fa4a926d..28d3aef1660b4d787910d4dcdca540ebbbcc6b9f 100644 (file)
@@ -168,6 +168,11 @@ static int of_coresight_parse_endpoint(struct device *dev,
                ret = 1;
        } while (0);
 
+       if (rparent)
+               of_node_put(rparent);
+       if (rport)
+               of_node_put(rport);
+
        return ret;
 }