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>] [day] [month] [year] [list]
Message-ID: <20201028193223.GF1042@kadam>
Date:   Wed, 28 Oct 2020 22:32:23 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Luca Coelho <luciano.coelho@...el.com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1049 iwl_pci_probe()
 warn: mask and shift to zero

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ed8780e3f2ecc82645342d070c6b4e530532e680
commit: d6f2134a383168bfb28ac458f7e4311e58482439 iwlwifi: add mac/rf types and 160MHz to the device tables
config: parisc-randconfig-m031-20201028 (attached as .config)
compiler: hppa64-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1049 iwl_pci_probe() warn: mask and shift to zero


vim +1049 drivers/net/wireless/intel/iwlwifi/pcie/drv.c

d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1034  
2a612a60ab440e6 drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2019-10-10  1035  	for (i = 0; i < ARRAY_SIZE(iwl_dev_info_table); i++) {
2a612a60ab440e6 drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2019-10-10  1036  		const struct iwl_dev_info *dev_info = &iwl_dev_info_table[i];
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1037  		if ((dev_info->device == (u16)IWL_CFG_ANY ||
2a612a60ab440e6 drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2019-10-10  1038  		     dev_info->device == pdev->device) &&
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1039  		    (dev_info->subdevice == (u16)IWL_CFG_ANY ||
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1040  		     dev_info->subdevice == pdev->subsystem_device) &&
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1041  		    (dev_info->mac_type == (u16)IWL_CFG_ANY ||
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1042  		     dev_info->mac_type ==
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1043  		     CSR_HW_REV_TYPE(iwl_trans->hw_rev)) &&
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1044  		    (dev_info->rf_type == (u16)IWL_CFG_ANY ||
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1045  		     dev_info->rf_type ==
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1046  		     CSR_HW_RFID_TYPE(iwl_trans->hw_rf_id)) &&
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1047  		    (dev_info->no_160 == (u8)IWL_CFG_ANY ||
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09  1048  		     dev_info->no_160 ==
d6f2134a383168b drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2020-03-09 @1049  		     IWL_SUBDEVICE_NO_160(pdev->subsystem_device))) {
                                                                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The IWL_SUBDEVICE_NO_160() is:

#define IWL_SUBDEVICE_NO_160(subdevice) ((u16)((subdevice) & 0x0100) >> 9

And 0x100 >> 9 is zero.  Probably either the mask or the shift is has a
typo.

2a612a60ab440e6 drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2019-10-10  1050  			iwl_trans->cfg = dev_info->cfg;
0b295a1eb81f37d drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2019-10-10  1051  			iwl_trans->name = dev_info->name;
2a612a60ab440e6 drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2019-10-10  1052  			goto found;
2a612a60ab440e6 drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2019-10-10  1053  		}
7d34a7d7da97bc8 drivers/net/wireless/intel/iwlwifi/pcie/drv.c Luca Coelho       2019-07-12  1054  	}

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

Download attachment ".config.gz" of type "application/gzip" (34930 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ