Hello Hou Tao,
This is a semi-automatic email about new static checker warnings.
Commit b4b7a4099b8c ("selftests/bpf: Factor out get_xlated_program()
helper") from Jan 5, 2024, leads to the following Smatch complaint:
./tools/testing/selftests/bpf/testing_helpers.c:455 get_xlated_program()
warn: variable dereferenced before check 'buf' (see line 454)
./tools/testing/selftests/bpf/testing_helpers.c
453 *cnt = xlated_prog_len / buf_element_size;
454 *buf = calloc(*cnt, buf_element_size);
455 if (!buf) {
^^^
This should be *buf.
456 perror("can't allocate xlated program buffer");
457 return -ENOMEM;
regards,
dan carpenter