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] [thread-next>] [day] [month] [year] [list]
Message-ID: <202204060410.mWlznHB9-lkp@intel.com>
Date:   Wed, 6 Apr 2022 04:44:25 +0800
From:   kernel test robot <lkp@...el.com>
To:     David Kahurani <k.kahurani@...il.com>, netdev@...r.kernel.org
Cc:     kbuild-all@...ts.01.org,
        syzbot+d3dbdf31fbe9d8f5f311@...kaller.appspotmail.com,
        davem@...emloft.net, jgg@...pe.ca, kuba@...nel.org,
        linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
        phil@...lpotter.co.uk, syzkaller-bugs@...glegroups.com,
        arnd@...db.de, paskripkin@...il.com,
        David Kahurani <k.kahurani@...il.com>
Subject: Re: [PATCH] net: ax88179: add proper error handling of usb read
 errors

Hi David,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net/master]
[also build test WARNING on net-next/master horms-ipvs/master linus/master v5.18-rc1 next-20220405]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Kahurani/net-ax88179-add-proper-error-handling-of-usb-read-errors/20220404-231226
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git 692930cc435099580a4b9e32fa781b0688c18439
config: i386-randconfig-m021-20220404 (https://download.01.org/0day-ci/archive/20220406/202204060410.mWlznHB9-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0

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

smatch warnings:
drivers/net/usb/ax88179_178a.c:1164 ax88179_check_eeprom() warn: inconsistent indenting

vim +1164 drivers/net/usb/ax88179_178a.c

e2ca90c276e1fc4 Freddy Xin     2013-03-02  1132  
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1133  static int ax88179_check_eeprom(struct usbnet *dev)
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1134  {
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1135  	u8 i, buf, eeprom[20];
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1136  	u16 csum, delay = HZ / 10;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1137  	unsigned long jtimeout;
c006257c3aa36f6 David Kahurani 2022-04-04  1138  	int ret;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1139  
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1140  	/* Read EEPROM content */
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1141  	for (i = 0; i < 6; i++) {
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1142  		buf = i;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1143  		if (ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_SROM_ADDR,
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1144  				      1, 1, &buf) < 0)
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1145  			return -EINVAL;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1146  
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1147  		buf = EEP_RD;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1148  		if (ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_SROM_CMD,
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1149  				      1, 1, &buf) < 0)
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1150  			return -EINVAL;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1151  
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1152  		jtimeout = jiffies + delay;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1153  		do {
c006257c3aa36f6 David Kahurani 2022-04-04  1154  		    ret = ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_SROM_CMD,
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1155  					   1, 1, &buf);
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1156  
c006257c3aa36f6 David Kahurani 2022-04-04  1157  		    if (ret < 0) {
c006257c3aa36f6 David Kahurani 2022-04-04  1158  			    netdev_dbg(dev->net,
c006257c3aa36f6 David Kahurani 2022-04-04  1159  				       "Failed to read SROM_CMD: %d\n",
c006257c3aa36f6 David Kahurani 2022-04-04  1160  			               ret);
c006257c3aa36f6 David Kahurani 2022-04-04  1161  			    return ret;
c006257c3aa36f6 David Kahurani 2022-04-04  1162  		    }
c006257c3aa36f6 David Kahurani 2022-04-04  1163  
e2ca90c276e1fc4 Freddy Xin     2013-03-02 @1164  			if (time_after(jiffies, jtimeout))
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1165  				return -EINVAL;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1166  
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1167  		} while (buf & EEP_BUSY);
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1168  
c006257c3aa36f6 David Kahurani 2022-04-04  1169  		ret = __ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_SROM_DATA_LOW,
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1170  				         2, 2, &eeprom[i * 2], 0);
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1171  
c006257c3aa36f6 David Kahurani 2022-04-04  1172  		if (ret < 0) {
c006257c3aa36f6 David Kahurani 2022-04-04  1173  			netdev_dbg(dev->net,
c006257c3aa36f6 David Kahurani 2022-04-04  1174  				   "Failed to read SROM_DATA_LOW: %d\n",
c006257c3aa36f6 David Kahurani 2022-04-04  1175  			           ret);
c006257c3aa36f6 David Kahurani 2022-04-04  1176  			return ret;
c006257c3aa36f6 David Kahurani 2022-04-04  1177  		}
c006257c3aa36f6 David Kahurani 2022-04-04  1178  
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1179  		if ((i == 0) && (eeprom[0] == 0xFF))
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1180  			return -EINVAL;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1181  	}
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1182  
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1183  	csum = eeprom[6] + eeprom[7] + eeprom[8] + eeprom[9];
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1184  	csum = (csum >> 8) + (csum & 0xff);
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1185  	if ((csum + eeprom[10]) != 0xff)
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1186  		return -EINVAL;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1187  
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1188  	return 0;
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1189  }
e2ca90c276e1fc4 Freddy Xin     2013-03-02  1190  

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ