aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-09-16 21:29:04 +0800
committerMathieu Poirier <mathieu.poirier@linaro.org>2018-09-19 17:40:21 -0600
commita8182859510fc269eeb499ce0f7d7dc43e2cb233 (patch)
treef05a051568360f4222da547d7e9b2b98bf521d08
parent8d082fe251a18b42a47fc18ca5cbf0c7163fb440 (diff)
downloadcoresight-next.tar.gz
hwtracing: coresight: remove redundant null pointer check before of_node_put and put_devicenext
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 <zhongjiang@huawei.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r--drivers/hwtracing/coresight/of_coresight.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
index da71c975e3f7..89092f83567e 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;
}