aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/coresight/coresight-tmc-etf.c
diff options
context:
space:
mode:
authorSuzuki K Poulose <suzuki.poulose@arm.com>2016-08-25 15:18:56 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-31 13:05:42 +0200
commit068c0a542f6edce90f7d8a9b35a849d990001018 (patch)
tree9f23c54f2fc784593a2f17e053151c199169a481 /drivers/hwtracing/coresight/coresight-tmc-etf.c
parentcoresight: Consolidate error handling path for tmc_probe (diff)
downloadlinux-dev-068c0a542f6edce90f7d8a9b35a849d990001018.tar.xz
linux-dev-068c0a542f6edce90f7d8a9b35a849d990001018.zip
coresight: Fix csdev connections initialisation
This is a cleanup patch. coresight_device->conns holds an array to point to the devices connected to the OUT ports of a component. Sinks, e.g ETR, do not have an OUT port (nr_outport = 0), as it streams the trace to memory via AXI. At coresight_register() we do : conns = kcalloc(csdev->nr_outport, sizeof(*conns), GFP_KERNEL); if (!conns) { ret = -ENOMEM; goto err_kzalloc_conns; } For ETR, since the total size requested for kcalloc is zero, the return value is, ZERO_SIZE_PTR ( != NULL). Hence, csdev->conns = ZERO_SIZE_PTR which cannot be verified later to contain a valid pointer. The code which accesses the csdev->conns is bounded by the csdev->nr_outport check, hence we don't try to dereference the ZERO_SIZE_PTR. This patch cleans up the csdev->conns initialisation to make sure we initialise it properly(i.e, either NULL or valid conns array). Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-tmc-etf.c')
0 files changed, 0 insertions, 0 deletions