From: zhong jiang Date: Thu, 20 Sep 2018 19:18:19 +0000 (-0600) Subject: coresight: Remove redundant null pointer check before of_node_put and put_device X-Git-Tag: v5.15~7734^2~138 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbbecc644a4fff76e8c89b9859701bdcde198d9c;p=platform%2Fkernel%2Flinux-starfive.git coresight: Remove redundant null pointer check before of_node_put and put_device of_node_put and put_device has taken the null pointer check into account. So it is safe to remove the duplicated check. Signed-off-by: zhong jiang Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c index da71c97..89092f8 100644 --- a/drivers/hwtracing/coresight/of_coresight.c +++ b/drivers/hwtracing/coresight/of_coresight.c @@ -219,12 +219,9 @@ static int of_coresight_parse_endpoint(struct device *dev, ret = 1; } while (0); - if (rparent) - of_node_put(rparent); - if (rep) - of_node_put(rep); - if (rdev) - put_device(rdev); + of_node_put(rparent); + of_node_put(rep); + put_device(rdev); return ret; }