aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorPierre-Louis Bossart <[email protected]>2023-07-31 16:37:42 -0500
committerMark Brown <[email protected]>2023-07-31 23:22:13 +0100
commite44222c213678d6ef646d72cbb9a2eda52f6dc22 (patch)
treeda5c5aa860cc81da67be4b7dcbdc7879927ef287 /tools/perf/scripts/python
parent390e7066db29b985c5142513955797c1166b623a (diff)
ASoC: SOF: ipc3: add checks to prevent static analysis warnings
make KCFLAGS='-fanalyzer' sound/soc/sof/ reports an issue with memcpy: sound/soc/sof/ipc3.c: In function ‘ipc3_wait_tx_done’: sound/soc/sof/ipc3.c:309:33: error: use of NULL ‘reply_data’ where non-null expected [CWE-476] [-Werror=analyzer-null-argument] 309 | memcpy(reply_data, msg->reply_data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 310 | msg->reply_size); The finding is legit with this call: return sof_ipc3_tx_msg(sdev, &pm_ctx, sizeof(pm_ctx), NULL, 0, false); Static analysis has no way of knowing that the reply will be zero-sized. Add a check to only do the memcpy if the reply size is not zero and the destination pointer is not NULL. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Reviewed-by: Yaochun Hung <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions