diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2021-04-09 09:49:01 +0000 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2021-04-13 09:46:27 -0600 |
commit | 68d400c079978f649e7f63aba966d219743edd64 (patch) | |
tree | 8f872e730188bf737867c7571f1cfd8f8faebd79 | |
parent | d19dea75b9920cfd78df397e836d5b885b4fcc37 (diff) | |
download | linux-68d400c079978f649e7f63aba966d219743edd64.tar.gz linux-68d400c079978f649e7f63aba966d219743edd64.tar.bz2 linux-68d400c079978f649e7f63aba966d219743edd64.zip |
coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
In case of error, the function devm_kasprintf() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210409094901.1903622-1-weiyongjun1@huawei.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r-- | drivers/hwtracing/coresight/coresight-trbe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c index 5ce239875c98..176868496879 100644 --- a/drivers/hwtracing/coresight/coresight-trbe.c +++ b/drivers/hwtracing/coresight/coresight-trbe.c @@ -871,7 +871,7 @@ static void arm_trbe_register_coresight_cpu(struct trbe_drvdata *drvdata, int cp dev = &cpudata->drvdata->pdev->dev; desc.name = devm_kasprintf(dev, GFP_KERNEL, "trbe%d", cpu); - if (IS_ERR(desc.name)) + if (!desc.name) goto cpu_clear; desc.type = CORESIGHT_DEV_TYPE_SINK; |