lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202501162038.zXreDkFM-lkp@intel.com>
Date: Thu, 16 Jan 2025 20:33:35 +0800
From: kernel test robot <lkp@...el.com>
To: Jiawen Wu <jiawenwu@...stnetic.com>, andrew+netdev@...n.ch,
	davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, linux@...linux.org.uk, horms@...nel.org,
	netdev@...r.kernel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	mengyuanlou@...-swift.com, Jiawen Wu <jiawenwu@...stnetic.com>
Subject: Re: [PATCH net-next v3 1/2] net: txgbe: Add basic support for new
 AML devices

Hi Jiawen,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jiawen-Wu/net-wangxun-Replace-the-judgement-of-MAC-type-with-flags/20250115-180916
base:   net-next/main
patch link:    https://lore.kernel.org/r/20250115102408.2225055-1-jiawenwu%40trustnetic.com
patch subject: [PATCH net-next v3 1/2] net: txgbe: Add basic support for new AML devices
config: powerpc-randconfig-001-20250116 (https://download.01.org/0day-ci/archive/20250116/202501162038.zXreDkFM-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project c23f2417dc5f6dc371afb07af5627ec2a9d373a0)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250116/202501162038.zXreDkFM-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501162038.zXreDkFM-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/wangxun/libwx/wx_hw.c:451:12: warning: variable 'recv_hdr' is uninitialized when used here [-Wuninitialized]
     451 |         buf_len = recv_hdr->buf_len;
         |                   ^~~~~~~~
   drivers/net/ethernet/wangxun/libwx/wx_hw.c:406:29: note: initialize the variable 'recv_hdr' to silence this warning
     406 |         struct wx_hic_hdr *recv_hdr;
         |                                    ^
         |                                     = NULL
   1 warning generated.


vim +/recv_hdr +451 drivers/net/ethernet/wangxun/libwx/wx_hw.c

   400	
   401	static int wx_host_interface_command_r(struct wx *wx, u32 *buffer,
   402					       u32 length, u32 timeout, bool return_data)
   403	{
   404		struct wx_hic_hdr *send_hdr = (struct wx_hic_hdr *)buffer;
   405		u32 hdr_size = sizeof(struct wx_hic_hdr);
   406		struct wx_hic_hdr *recv_hdr;
   407		bool busy, reply;
   408		u32 dword_len;
   409		u16 buf_len;
   410		int err = 0;
   411		u8 send_cmd;
   412		u32 i;
   413	
   414		/* wait to get lock */
   415		might_sleep();
   416		err = read_poll_timeout(test_and_set_bit, busy, !busy, 1000, timeout * 1000,
   417					false, WX_STATE_SWFW_BUSY, wx->state);
   418		if (err)
   419			return err;
   420	
   421		/* index to unique seq id for each mbox message */
   422		send_hdr->index = wx->swfw_index;
   423		send_cmd = send_hdr->cmd;
   424	
   425		dword_len = length >> 2;
   426		/* write data to SW-FW mbox array */
   427		for (i = 0; i < dword_len; i++) {
   428			wr32a(wx, WX_SW2FW_MBOX, i, (__force u32)cpu_to_le32(buffer[i]));
   429			/* write flush */
   430			rd32a(wx, WX_SW2FW_MBOX, i);
   431		}
   432	
   433		/* generate interrupt to notify FW */
   434		wr32m(wx, WX_SW2FW_MBOX_CMD, WX_SW2FW_MBOX_CMD_VLD, 0);
   435		wr32m(wx, WX_SW2FW_MBOX_CMD, WX_SW2FW_MBOX_CMD_VLD, WX_SW2FW_MBOX_CMD_VLD);
   436	
   437		/* polling reply from FW */
   438		err = read_poll_timeout(wx_poll_fw_reply, reply, reply, 1000, 50000,
   439					true, wx, buffer, recv_hdr, send_cmd);
   440		if (err) {
   441			wx_err(wx, "Polling from FW messages timeout, cmd: 0x%x, index: %d\n",
   442			       send_cmd, wx->swfw_index);
   443			goto rel_out;
   444		}
   445	
   446		/* expect no reply from FW then return */
   447		if (!return_data)
   448			goto rel_out;
   449	
   450		/* If there is any thing in data position pull it in */
 > 451		buf_len = recv_hdr->buf_len;
   452		if (buf_len == 0)
   453			goto rel_out;
   454	
   455		if (length < buf_len + hdr_size) {
   456			wx_err(wx, "Buffer not large enough for reply message.\n");
   457			err = -EFAULT;
   458			goto rel_out;
   459		}
   460	
   461		/* Calculate length in DWORDs, add 3 for odd lengths */
   462		dword_len = (buf_len + 3) >> 2;
   463		for (i = hdr_size >> 2; i <= dword_len; i++) {
   464			buffer[i] = rd32a(wx, WX_FW2SW_MBOX, i);
   465			le32_to_cpus(&buffer[i]);
   466		}
   467	
   468	rel_out:
   469		/* index++, index replace wx_hic_hdr.checksum */
   470		if (send_hdr->index == WX_HIC_HDR_INDEX_MAX)
   471			wx->swfw_index = 0;
   472		else
   473			wx->swfw_index = send_hdr->index + 1;
   474	
   475		clear_bit(WX_STATE_SWFW_BUSY, wx->state);
   476		return err;
   477	}
   478	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ