driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8BOB3 CVE: NA
----------------------------------------------------------------------
The mainline`s patch [1] fix the issue, revert the private patch. This reverts commit d0904fb6ad6acf86d607e60a787c1f07ce76ad7a.
[1] a385634e45ff "coresight: trbe: Add a representative coresight_platform_data for TRBE"
Signed-off-by: Junhao He hejunhao3@huawei.com --- drivers/hwtracing/coresight/coresight-platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c index 79a6acb951fe..e15592cdd20f 100644 --- a/drivers/hwtracing/coresight/coresight-platform.c +++ b/drivers/hwtracing/coresight/coresight-platform.c @@ -862,15 +862,15 @@ coresight_get_platform_data(struct device *dev) struct coresight_platform_data *pdata = NULL; struct fwnode_handle *fwnode = dev_fwnode(dev);
+ if (IS_ERR_OR_NULL(fwnode)) + goto error; + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) { ret = -ENOMEM; goto error; }
- if (IS_ERR_OR_NULL(fwnode)) - return pdata; - if (is_of_node(fwnode)) ret = of_get_coresight_platform_data(dev, pdata); else if (is_acpi_device_node(fwnode))