Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yunsheng Lin <yunshenglin0825@gmail.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [linyunsheng:page_frag_cache_part2_v3_250105 8/8] net/core/skbuff.c:3091:28: warning: variable 'nc_page' is uninitialized when used here
Date: Thu, 9 Jan 2025 03:14:04 +0800	[thread overview]
Message-ID: <202501090341.yJ16qGyH-lkp@intel.com> (raw)

tree:   https://github.com/gestionlin/linux.git page_frag_cache_part2_v3_250105
head:   c94404d3ba31c8322393ffbabf85a5c98e965b4f
commit: c94404d3ba31c8322393ffbabf85a5c98e965b4f [8/8] replace fix
config: riscv-randconfig-002-20250109 (https://download.01.org/0day-ci/archive/20250109/202501090341.yJ16qGyH-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250109/202501090341.yJ16qGyH-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501090341.yJ16qGyH-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> net/core/skbuff.c:3091:28: warning: variable 'nc_page' is uninitialized when used here [-Wuninitialized]
           if (spd_can_coalesce(spd, nc_page, nc_offset)) {
                                     ^~~~~~~
   net/core/skbuff.c:3081:22: note: initialize the variable 'nc_page' to silence this warning
           struct page *nc_page;
                               ^
                                = NULL
>> net/core/skbuff.c:3091:37: warning: variable 'nc_offset' is uninitialized when used here [-Wuninitialized]
           if (spd_can_coalesce(spd, nc_page, nc_offset)) {
                                              ^~~~~~~~~
   net/core/skbuff.c:3080:24: note: initialize the variable 'nc_offset' to silence this warning
           unsigned int nc_offset;
                                 ^
                                  = 0
   2 warnings generated.


vim +/nc_page +3091 net/core/skbuff.c

  3074	
  3075	static bool spd_fill_linear_page(struct splice_pipe_desc *spd,
  3076					 struct page *page, unsigned int offset,
  3077					 unsigned int *len, struct sock *sk)
  3078	{
  3079		struct page_frag_cache *nc = sk_page_frag_cache(sk);
  3080		unsigned int nc_offset;
  3081		struct page *nc_page;
  3082		void *va;
  3083	
  3084		if (!sk_page_frag_cache_refill(sk, nc))
  3085			return true;
  3086	
  3087		*len = min_t(unsigned int, *len, page_frag_cache_remaining(nc));
  3088		va = page_frag_cache_virt(nc);
  3089		memcpy(va, page_address(page) + offset, *len);
  3090	
> 3091		if (spd_can_coalesce(spd, nc_page, nc_offset)) {
  3092			spd->partial[spd->nr_pages - 1].len += *len;
  3093			page_frag_cache_commit_noref(nc, *len);
  3094			return false;
  3095		}
  3096	
  3097		page_frag_cache_commit(nc, *len);
  3098		spd->pages[spd->nr_pages] = nc_page;
  3099		spd->partial[spd->nr_pages].len = *len;
  3100		spd->partial[spd->nr_pages].offset = nc_offset;
  3101		spd->nr_pages++;
  3102	
  3103		return false;
  3104	}
  3105	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2025-01-08 19:14 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=202501090341.yJ16qGyH-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yunshenglin0825@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