linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [toke:xdp-queueing-01 1/3] kernel/bpf/pifomap.c:149 pifo_map_lookup_elem() error: uninitialized symbol 'pkt'.
Date: Sat, 10 Jul 2021 17:51:00 +0300	[thread overview]
Message-ID: <202107100443.yNr9SYE7-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git xdp-queueing-01
head:   6b5756c44933d2b55e5e59e1196ef95894203cf7
commit: b8d0d0f924c237daf55b430a85007bd41ad01d7e [1/3] Add a PIFO map type for queueing packets
config: i386-randconfig-m021-20210709 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
kernel/bpf/pifomap.c:149 pifo_map_lookup_elem() error: uninitialized symbol 'pkt'.

vim +/pkt +149 kernel/bpf/pifomap.c

b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  140  static void *pifo_map_lookup_elem(struct bpf_map *map, void *key)
b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  141  {
b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  142  	struct bpf_pifo_map *pifo = container_of(map, struct bpf_pifo_map, map);
b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  143  	struct bpf_pifo_pkt *pkt;
b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  144  	u32 pktid =  *(u32 *)key;
b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  145  
b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  146  	if (pktid < pifo->qsize)
b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  147  		pkt = &pifo->q[pktid];

Not initialized on else path.

b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  148  
b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30 @149  	return pkt ? &pkt->pkt_id : NULL;
                                                               ^^^

b8d0d0f924c237 Toke Høiland-Jørgensen 2021-06-30  150  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


                 reply	other threads:[~2021-07-10 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202107100443.yNr9SYE7-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=toke@redhat.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;
as well as URLs for NNTP newsgroup(s).