Skip to content

Commit d21e5f7

Browse files
committed
mctp-bench: fix uninitialised warning for last_rc
We have a warning with optimisation enabled: ../src/mctp-bench.c:309:46: warning: ‘last_rc’ may be used uninitialized [-Wmaybe-uninitialized] 309 | if (rc != (int)send_args.len && rc != last_rc) { Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
1 parent 4d77611 commit d21e5f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mctp-bench.c

+4
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ static int mctp_bench_send(struct mctp_bench_send_args send_args)
300300

301301
hdr = (struct msg_header *)buf;
302302
hdr->magic = MAGIC_VAL;
303+
304+
/* will not match a sensible sendto() return value */
305+
last_rc = 0;
306+
303307
while (1) {
304308
addr.smctp_tag = tag;
305309
hdr->seq_no = sequence;

0 commit comments

Comments
 (0)