public inbox for [email protected]
 help / color / mirror / Atom feed
* [ammarfaizi2-block:dhowells/linux-fs/rxrpc-fixes 1/5] net/rxrpc/peer_event.c:416:6: warning: variable 'peer' is used uninitialized whenever 'if' condition is false
@ 2022-08-30 23:41 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-08-30 23:41 UTC (permalink / raw)
  To: David Howells
  Cc: llvm, kbuild-all, Ammar Faizi, GNU/Weeb Mailing List,
	linux-kernel

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/rxrpc-fixes
head:   5ba1502ed90c38548d56a41156440fa70aed70ed
commit: b445daa0f2ca96635e9620cef26a72619ce3644a [1/5] rxrpc: Fix ICMP/ICMP6 error handling
config: hexagon-buildonly-randconfig-r006-20220830 (https://download.01.org/0day-ci/archive/20220831/[email protected]/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project c7df82e4693c19e3fd2e25c83eb04d9deb7b7b59)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/ammarfaizi2/linux-block/commit/b445daa0f2ca96635e9620cef26a72619ce3644a
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/rxrpc-fixes
        git checkout b445daa0f2ca96635e9620cef26a72619ce3644a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash net/rxrpc/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

>> net/rxrpc/peer_event.c:416:6: warning: variable 'peer' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (serr->ee.ee_origin == SO_EE_ORIGIN_LOCAL) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/rxrpc/peer_event.c:428:17: note: uninitialized use occurs here
           rxrpc_put_peer(peer);
                          ^~~~
   net/rxrpc/peer_event.c:416:2: note: remove the 'if' if its condition is always true
           if (serr->ee.ee_origin == SO_EE_ORIGIN_LOCAL) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/rxrpc/peer_event.c:391:25: note: initialize the variable 'peer' to silence this warning
           struct rxrpc_peer *peer;
                                  ^
                                   = NULL
   1 warning generated.


vim +416 net/rxrpc/peer_event.c

   382	
   383	/*
   384	 * Handle an error received on the local endpoint.
   385	 */
   386	void rxrpc_error_report(struct sock *sk)
   387	{
   388		struct sock_exterr_skb *serr;
   389		struct sockaddr_rxrpc srx;
   390		struct rxrpc_local *local;
   391		struct rxrpc_peer *peer;
   392		struct sk_buff *skb;
   393	
   394		rcu_read_lock();
   395		local = rcu_dereference_sk_user_data(sk);
   396		if (unlikely(!local)) {
   397			rcu_read_unlock();
   398			return;
   399		}
   400		_enter("%p{%d}", sk, local->debug_id);
   401	
   402		/* Clear the outstanding error value on the socket so that it doesn't
   403		 * cause kernel_sendmsg() to return it later.
   404		 */
   405		sock_error(sk);
   406	
   407		skb = sock_dequeue_err_skb(sk);
   408		if (!skb) {
   409			rcu_read_unlock();
   410			_leave("UDP socket errqueue empty");
   411			return;
   412		}
   413		rxrpc_new_skb(skb, rxrpc_skb_received);
   414		serr = SKB_EXT_ERR(skb);
   415	
 > 416		if (serr->ee.ee_origin == SO_EE_ORIGIN_LOCAL) {
   417			peer = rxrpc_lookup_peer_local_rcu(local, skb, &srx);
   418			if (peer && !rxrpc_get_peer_maybe(peer))
   419				peer = NULL;
   420			if (peer) {
   421				trace_rxrpc_rx_icmp(peer, &serr->ee, &srx);
   422				rxrpc_store_error(peer, serr);
   423			}
   424		}
   425	
   426		rcu_read_unlock();
   427		rxrpc_free_skb(skb, rxrpc_skb_freed);
   428		rxrpc_put_peer(peer);
   429		_leave("");
   430	}
   431	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-30 23:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-30 23:41 [ammarfaizi2-block:dhowells/linux-fs/rxrpc-fixes 1/5] net/rxrpc/peer_event.c:416:6: warning: variable 'peer' is used uninitialized whenever 'if' condition is false kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox