* [PATCH -next] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
@ 2021-04-09 1:22 ` Wei Yongjun
0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2021-04-09 1:22 UTC (permalink / raw)
To: weiyongjun1, Anshuman Khandual, Mathieu Poirier,
Suzuki K Poulose, Alexander Shishkin
Cc: coresight, linux-arm-kernel, linux-kernel, kernel-janitors, Hulk Robot
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.
Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/hwtracing/coresight/coresight-trbe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH -next] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
@ 2021-04-09 1:22 ` Wei Yongjun
0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2021-04-09 1:22 UTC (permalink / raw)
To: weiyongjun1, Anshuman Khandual, Mathieu Poirier,
Suzuki K Poulose, Alexander Shishkin
Cc: coresight, linux-arm-kernel, linux-kernel, kernel-janitors, Hulk Robot
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.
Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/hwtracing/coresight/coresight-trbe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
2021-04-09 1:22 ` Wei Yongjun
@ 2021-04-09 9:12 ` Anshuman Khandual
-1 siblings, 0 replies; 4+ messages in thread
From: Anshuman Khandual @ 2021-04-09 9:12 UTC (permalink / raw)
To: Wei Yongjun, Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin
Cc: coresight, linux-arm-kernel, linux-kernel, kernel-janitors, Hulk Robot
On 4/9/21 6:52 AM, Wei Yongjun wrote:
> 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.
Right.
>
> Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver")
Again, dont think this warrants "Fixes:" tag as there were no
functional problem to be fixed here.
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/hwtracing/coresight/coresight-trbe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
>
LGTM.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
@ 2021-04-09 9:12 ` Anshuman Khandual
0 siblings, 0 replies; 4+ messages in thread
From: Anshuman Khandual @ 2021-04-09 9:12 UTC (permalink / raw)
To: Wei Yongjun, Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin
Cc: coresight, linux-arm-kernel, linux-kernel, kernel-janitors, Hulk Robot
On 4/9/21 6:52 AM, Wei Yongjun wrote:
> 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.
Right.
>
> Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver")
Again, dont think this warrants "Fixes:" tag as there were no
functional problem to be fixed here.
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/hwtracing/coresight/coresight-trbe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
>
LGTM.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-09 9:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09 1:22 [PATCH -next] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu() Wei Yongjun
2021-04-09 1:22 ` Wei Yongjun
2021-04-09 9:12 ` Anshuman Khandual
2021-04-09 9:12 ` Anshuman Khandual
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.