From: Kaixu Xia <xiakaixu@huawei.com>
Date: Fri, 9 Jan 2015 23:57:22 +0000 (-0700)
Subject: coresight: fixing validity check on remote device
X-Git-Tag: firefly_0821_release~176^2~2322^2~48
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2ccffaf92e7b7cc9dfa6c3458fc9cb151621680a;p=firefly-linux-kernel-4.4.55.git

coresight: fixing validity check on remote device

A validity check should be made on the remote device, i.e rdev,
rather than the current device.

Signed-off-by: Kaixu Xia <xiakaixu@huawei.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

diff --git a/drivers/coresight/of_coresight.c b/drivers/coresight/of_coresight.c
index 89ebbe29ac97..9a5ff56f34d9 100644
--- a/drivers/coresight/of_coresight.c
+++ b/drivers/coresight/of_coresight.c
@@ -174,7 +174,7 @@ struct coresight_platform_data *of_get_coresight_platform_data(
 				continue;
 
 			rdev = of_coresight_get_endpoint_device(rparent);
-			if (!dev)
+			if (!rdev)
 				continue;
 
 			pdata->child_names[i] = dev_name(rdev);