diff options
| author | zhong jiang <zhongjiang@huawei.com> | 2018-09-20 15:18:19 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-25 14:09:19 -0400 |
| commit | bbbecc644a4fff76e8c89b9859701bdcde198d9c (patch) | |
| tree | 40d7714288f4a5a1efa04547d489e6b6e4e14565 /drivers/hwtracing | |
| parent | 1cf11385f354acbadd20f55e41be9bb1db8b1b2c (diff) | |
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 <zhongjiang@huawei.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing')
| -rw-r--r-- | drivers/hwtracing/coresight/of_coresight.c | 9 |
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, | |||
| 219 | ret = 1; | 219 | ret = 1; |
| 220 | } while (0); | 220 | } while (0); |
| 221 | 221 | ||
| 222 | if (rparent) | 222 | of_node_put(rparent); |
| 223 | of_node_put(rparent); | 223 | of_node_put(rep); |
| 224 | if (rep) | 224 | put_device(rdev); |
| 225 | of_node_put(rep); | ||
| 226 | if (rdev) | ||
| 227 | put_device(rdev); | ||
| 228 | 225 | ||
| 229 | return ret; | 226 | return ret; |
| 230 | } | 227 | } |
