[bug report] selftests/bpf: Factor out get_xlated_program() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux