summaryrefslogtreecommitdiff
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorLin Yujun <linyujun809@h-partners.com>2025-09-08 20:20:22 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-15 12:00:16 +0200
commit8c4e7e646d5d9050b374baf5c6bb3a00fb79e206 (patch)
tree0d2a169d1cc886ffd0eb6e3d80b591951b65a8c6 /drivers/hwtracing
parentaf82868328552d8055899106bdcc047db0de4036 (diff)
downloadlinux-8c4e7e646d5d9050b374baf5c6bb3a00fb79e206.tar.gz
linux-8c4e7e646d5d9050b374baf5c6bb3a00fb79e206.tar.bz2
linux-8c4e7e646d5d9050b374baf5c6bb3a00fb79e206.zip
coresight: Fix incorrect handling for return value of devm_kzalloc
[ Upstream commit 70714eb7243eaf333d23501d4c7bdd9daf011c01 ] The return value of devm_kzalloc could be an null pointer, use "!desc.pdata" to fix incorrect handling return value of devm_kzalloc. Fixes: 4277f035d227 ("coresight: trbe: Add a representative coresight_platform_data for TRBE") Signed-off-by: Lin Yujun <linyujun809@h-partners.com> Reviewed-by: James Clark <james.clark@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20250908122022.1315399-1-linyujun809@h-partners.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hwtracing')
-rw-r--r--drivers/hwtracing/coresight/coresight-trbe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
index 575567491372..d771980a278d 100644
--- a/drivers/hwtracing/coresight/coresight-trbe.c
+++ b/drivers/hwtracing/coresight/coresight-trbe.c
@@ -1267,7 +1267,7 @@ static void arm_trbe_register_coresight_cpu(struct trbe_drvdata *drvdata, int cp
* into the device for that purpose.
*/
desc.pdata = devm_kzalloc(dev, sizeof(*desc.pdata), GFP_KERNEL);
- if (IS_ERR(desc.pdata))
+ if (!desc.pdata)
goto cpu_clear;
desc.type = CORESIGHT_DEV_TYPE_SINK;