summaryrefslogtreecommitdiffstats
path: root/samples/timers
diff options
context:
space:
mode:
authorSuzuki K Poulose2019-06-21 19:52:05 +0200
committerGreg Kroah-Hartman2019-07-03 21:16:37 +0200
commit17c20f329a139e90e4b049b811ca6d1a2ae967e0 (patch)
tree083d3d84e0b65074d95ec5dda2bc861694ba62b7 /samples/timers
parentcoresight: etm3x: Smatch: Fix potential NULL pointer dereference (diff)
downloadkernel-qcow2-linux-17c20f329a139e90e4b049b811ca6d1a2ae967e0.tar.gz
kernel-qcow2-linux-17c20f329a139e90e4b049b811ca6d1a2ae967e0.tar.xz
kernel-qcow2-linux-17c20f329a139e90e4b049b811ca6d1a2ae967e0.zip
coresight: tmc: Smatch: Fix potential NULL pointer dereference
Based on the following report from Smatch, fix the potential NULL pointer dereference check. The patch 743256e214e8: "coresight: tmc: Clean up device specific data" from May 22, 2019, leads to the following Smatch complaint: drivers/hwtracing/coresight/coresight-tmc-etr.c:625 tmc_etr_free_flat_buf() warn: variable dereferenced before check 'flat_buf' (see line 623) drivers/hwtracing/coresight/coresight-tmc-etr.c 622 struct etr_flat_buf *flat_buf = etr_buf->private; 623 struct device *real_dev = flat_buf->dev->parent; ^^^^^^^^^^ The patch introduces a new NULL check 624 625 if (flat_buf && flat_buf->daddr) ^^^^^^^^ but the existing code assumed it can be NULL. 626 dma_free_coherent(real_dev, flat_buf->size, 627 flat_buf->vaddr, flat_buf->daddr); Cc: Dan Carpenter <dan.carpenter@oracle.com> 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> Link: https://lore.kernel.org/r/20190621175205.24551-3-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples/timers')
0 files changed, 0 insertions, 0 deletions