From: Dan Carpenter <dan.carpenter@linaro.org>
To: eddyz87@gmail.com
Cc: bpf@vger.kernel.org
Subject: [bug report] selftests/bpf: specify expected instructions in test_verifier tests
Date: Tue, 6 Jun 2023 11:31:14 +0300 [thread overview]
Message-ID: <ZH7u0hEGVB4MjGZq@moroto> (raw)
Hello Eduard Zingerman,
This is a semi-automatic email about new static checker warnings.
The patch 933ff53191eb: "selftests/bpf: specify expected instructions
in test_verifier tests" from Jun 21, 2022, leads to the following
Smatch complaint:
./tools/testing/selftests/bpf/test_verifier.c:1365 get_xlated_program()
warn: variable dereferenced before check 'buf' (see line 1364)
./tools/testing/selftests/bpf/test_verifier.c
1363 *cnt = xlated_prog_len / buf_element_size;
1364 *buf = calloc(*cnt, buf_element_size);
1365 if (!buf) {
This should be if (!*buf) {
1366 perror("can't allocate xlated program buffer");
1367 return -ENOMEM;
regards,
dan carpenter
next reply other threads:[~2023-06-06 8:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 8:31 Dan Carpenter [this message]
2023-06-06 21:18 ` [bug report] selftests/bpf: specify expected instructions in test_verifier tests Eduard Zingerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZH7u0hEGVB4MjGZq@moroto \
--to=dan.carpenter@linaro.org \
--cc=bpf@vger.kernel.org \
--cc=eddyz87@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox