summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Binacchi <[email protected]>2026-06-26 20:33:49 +0200
committerTom Rini <[email protected]>2026-07-13 17:06:37 -0600
commit8d50a5ce721212f0b4277a3b24f5d07799970bee (patch)
treed9ed59d5fc63373019b9f8c57961980bc3ab7c40
parentab2266aff3622a1cf1a5e76a0702688b2bb538a5 (diff)
test: cmd: part: fix integer handling in setup_gpt_partitions()
Coverity reports an INTEGER_OVERFLOW issue because ut_asserteq() compares an unsigned int (mmc_dev_num) with ret, which can hold a negative error code. Addresses-Coverity-ID: CID 646439: Integer handling issues (INTEGER_OVERFLOW) Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Quentin Schulz <[email protected]>
-rw-r--r--test/cmd/part.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/cmd/part.c b/test/cmd/part.c
index e0149011476..b01bc286723 100644
--- a/test/cmd/part.c
+++ b/test/cmd/part.c
@@ -50,7 +50,7 @@ static int setup_gpt_partitions(struct unit_test_state *uts,
if (ret == -ENODEV)
return -EAGAIN;
- ut_asserteq(mmc_dev_num, ret);
+ ut_assert(ret >= 0 && ret == mmc_dev_num);
if (CONFIG_IS_ENABLED(RANDOM_UUID)) {
for (i = 0; i < ARRAY_SIZE(gpt_parts); i++)