diff options
| author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-04-21 13:42:41 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-30 12:42:15 +0100 |
| commit | d0c80f48fb2e7c643bdf93956273d9c2f01f08c7 (patch) | |
| tree | bec1e3ec5167320a773a05463ce2377f23aa9f70 /include/uapi | |
| parent | ffcb9e617ca27e5e3283e3bfcf6b16ebac4553dc (diff) | |
coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet()
commit f67bc15e526bb9920683ad6c1891ff9e08981335 upstream.
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 <dan.carpenter@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/7d33e244-d8b9-4c27-9653-883a13534b01@kili.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi')
0 files changed, 0 insertions, 0 deletions
