linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [cifs:for-next 8/9] fs/cifs/smb2transport.c:419:15: warning: variable 'chan_index' is uninitialized when used here
@ 2021-07-15 15:17 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-07-15 15:17 UTC (permalink / raw)
  To: Steve French; +Cc: clang-built-linux, kbuild-all, linux-cifs, samba-technical

[-- Attachment #1: Type: text/plain, Size: 4270 bytes --]

tree:   git://git.samba.org/sfrench/cifs-2.6.git for-next
head:   40dad7597b6bdbadb33434f1a667c43d6869a66d
commit: f3ce4fce27131ebec2c123ee6c2a4aee477f4b38 [8/9] smb3: add minor debug statement
config: x86_64-randconfig-r006-20210715 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 0e49c54a8cbd3e779e5526a5888c683c01cc3c50)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git remote add cifs git://git.samba.org/sfrench/cifs-2.6.git
        git fetch --no-tags cifs for-next
        git checkout f3ce4fce27131ebec2c123ee6c2a4aee477f4b38
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> fs/cifs/smb2transport.c:419:15: warning: variable 'chan_index' is uninitialized when used here [-Wuninitialized]
                            __func__, chan_index);
                                      ^~~~~~~~~~
   fs/cifs/cifs_debug.h:79:43: note: expanded from macro 'cifs_dbg'
                   cifs_dbg_func(ratelimited, type, fmt, ##__VA_ARGS__);   \
                                                           ^~~~~~~~~~~
   fs/cifs/cifs_debug.h:66:23: note: expanded from macro 'cifs_dbg_func'
                                         __FILE__, ##__VA_ARGS__);         \
                                                     ^~~~~~~~~~~
   include/linux/printk.h:584:50: note: expanded from macro 'pr_debug_ratelimited'
                   __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__);    \
                                                                  ^~~~~~~~~~~
   fs/cifs/smb2transport.c:401:25: note: initialize the variable 'chan_index' to silence this warning
           unsigned int chan_index;
                                  ^
                                   = 0
   1 warning generated.


vim +/chan_index +419 fs/cifs/smb2transport.c

   392	
   393	static int
   394	generate_smb3signingkey(struct cifs_ses *ses,
   395				const struct derivation_triplet *ptriplet)
   396	{
   397		int rc;
   398	#ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS
   399		struct TCP_Server_Info *server = ses->server;
   400	#endif
   401		unsigned int chan_index;
   402	
   403		/*
   404		 * All channels use the same encryption/decryption keys but
   405		 * they have their own signing key.
   406		 *
   407		 * When we generate the keys, check if it is for a new channel
   408		 * (binding) in which case we only need to generate a signing
   409		 * key and store it in the channel as to not overwrite the
   410		 * master connection signing key stored in the session
   411		 */
   412	
   413		if (ses->binding) {
   414			rc = generate_key(ses, ptriplet->signing.label,
   415					  ptriplet->signing.context,
   416					  cifs_ses_binding_channel(ses)->signkey,
   417					  SMB3_SIGN_KEY_SIZE);
   418			cifs_dbg(FYI, "%s: Generated key for chan %u\n",
 > 419				 __func__, chan_index);
   420			if (rc)
   421				return rc;
   422		} else {
   423			rc = generate_key(ses, ptriplet->signing.label,
   424					  ptriplet->signing.context,
   425					  ses->smb3signingkey,
   426					  SMB3_SIGN_KEY_SIZE);
   427			if (rc)
   428				return rc;
   429	
   430			memcpy(ses->chans[0].signkey, ses->smb3signingkey,
   431			       SMB3_SIGN_KEY_SIZE);
   432	
   433			rc = generate_key(ses, ptriplet->encryption.label,
   434					  ptriplet->encryption.context,
   435					  ses->smb3encryptionkey,
   436					  SMB3_ENC_DEC_KEY_SIZE);
   437			rc = generate_key(ses, ptriplet->decryption.label,
   438					  ptriplet->decryption.context,
   439					  ses->smb3decryptionkey,
   440					  SMB3_ENC_DEC_KEY_SIZE);
   441			if (rc)
   442				return rc;
   443		}
   444	
   445		if (rc)
   446			return rc;
   447	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 44479 bytes --]

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

only message in thread, other threads:[~2021-07-15 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 15:17 [cifs:for-next 8/9] fs/cifs/smb2transport.c:419:15: warning: variable 'chan_index' is uninitialized when used here kernel test robot

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