Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

coresight: Fix incorrect handling for return value of devm_kzalloc

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

authored by

Lin Yujun and committed by
Suzuki K Poulose
70714eb7 43e0a92c

+1 -1
+1 -1
drivers/hwtracing/coresight/coresight-trbe.c
··· 1280 1280 * into the device for that purpose. 1281 1281 */ 1282 1282 desc.pdata = devm_kzalloc(dev, sizeof(*desc.pdata), GFP_KERNEL); 1283 - if (IS_ERR(desc.pdata)) 1283 + if (!desc.pdata) 1284 1284 goto cpu_clear; 1285 1285 1286 1286 desc.type = CORESIGHT_DEV_TYPE_SINK;