diff options
author | Dan Carpenter <[email protected]> | 2023-04-21 13:42:41 +0300 |
---|---|---|
committer | Suzuki K Poulose <[email protected]> | 2023-05-11 11:18:21 +0100 |
commit | f67bc15e526bb9920683ad6c1891ff9e08981335 (patch) | |
tree | b305aea05d9fd21a311797c18693816cf41bb5c1 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | ac9a78681b921877518763ba0e89202254349d1b (diff) |
coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet()
This code generates a Smatch warning:
drivers/hwtracing/coresight/coresight-tmc-etr.c:947 tmc_etr_buf_insert_barrier_packet()
error: uninitialized symbol 'bufp'.
The problem is that if tmc_sg_table_get_data() returns -EINVAL, then
when we test if "len < CORESIGHT_BARRIER_PKT_SIZE", the negative "len"
value is type promoted to a high unsigned long value which is greater
than CORESIGHT_BARRIER_PKT_SIZE. Fix this bug by adding an explicit
check for error codes.
Fixes: 75f4e3619fe2 ("coresight: tmc-etr: Add transparent buffer management")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions