[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 Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux