summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorBill Wendling <morbo@google.com>2026-09-22 22:09:50 +0000
committerJonathan Cameron <jonathan.cameron@oss.qualcomm.com>2026-09-28 17:07:33 +0100
commit525b772be2c03773c5cc828b4c8ea5d94f5b00ca (patch)
treefd0c4653ae6000b8ecc83d1d29973cdee1e419cc /tools/perf/scripts/python/stackcollapse.py
parentaa26008e57ac28346032d82a92946ca6bf44d4ef (diff)
downloadlinux-next-525b772be2c03773c5cc828b4c8ea5d94f5b00ca.tar.gz
linux-next-525b772be2c03773c5cc828b4c8ea5d94f5b00ca.zip
iio: adc: qcom-adc5-gen3: Annotate struct adc5_device_data with __counted_by_ptr
Under compiler-supported bounds checking (via KASAN or UBSAN), pointer fields inside structures can be annotated with the '__counted_by_ptr' attribute to specify which field in the same structure holds the element count. This enables the compiler to perform runtime bounds checking on the pointer. Annotate the "base" pointer field in "struct adc5_device_data" with the "__counted_by_ptr" attribute pointing to "num_sdams". The number of SDAMs is determined from the device property and assigned to "num_sdams" which is then used to initialize "base" via "devm_kcalloc". By ensuring "num_sdams" is set to the correct element count prior to the "base" pointer allocation, and since the size of "base" is never reallocated or changed, this annotation is safe and will not cause any false-positive runtime bounds check panics or KASAN issues. Cc: codemender-patching+linux@google.com Assisted-by: LLM Signed-off-by: Bill Wendling <morbo@google.com> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Acked-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions