driver inclusion category: Bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I89TNS CVE: NA
----------------------------------------------------------------------
This reverts commit d0904fb6ad6acf86d607e60a787c1f07ce76ad7a.
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 82b900076dbd..c594f45319fc 100644 --- a/drivers/hwtracing/coresight/coresight-platform.c +++ b/drivers/hwtracing/coresight/coresight-platform.c @@ -844,15 +844,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))