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]
Date:   Sat, 2 Apr 2022 02:08:02 +0800
From:   kernel test robot <lkp@...el.com>
To:     Sevinj Aghayeva <sevinj.aghayeva@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     kbuild-all@...ts.01.org, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org, outreachy@...ts.linux.dev,
        Sevinj Aghayeva <sevinj.aghayeva@...il.com>
Subject: Re: [PATCH 3/3] staging: rtl8723bs: remove redundant else branches

Hi Sevinj,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v5.17 next-20220401]
[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/Sevinj-Aghayeva/rlt8723bs-cleanup/20220401-210507
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git b22c721c4f3fd4608da059c56fbe7a0cc598fb6a
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20220402/202204020208.cUdIa2Q2-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.0
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/intel-lab-lkp/linux/commit/ed0a6d578663ac28fa89918bc7ad86c0e6f82f8a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Sevinj-Aghayeva/rlt8723bs-cleanup/20220401-210507
        git checkout ed0a6d578663ac28fa89918bc7ad86c0e6f82f8a
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/staging/

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

All warnings (new ones prefixed by >>):

   drivers/staging/rtl8723bs/core/rtw_mlme_ext.c: In function 'OnDeAuth':
>> drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1505:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    1505 |         int     ignore_received_deauth = 0;
         |         ^~~


vim +1505 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c

554c0a3abf216c Hans de Goede   2017-03-29  1461  
554c0a3abf216c Hans de Goede   2017-03-29  1462  unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame)
554c0a3abf216c Hans de Goede   2017-03-29  1463  {
554c0a3abf216c Hans de Goede   2017-03-29  1464  	unsigned short	reason;
554c0a3abf216c Hans de Goede   2017-03-29  1465  	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
554c0a3abf216c Hans de Goede   2017-03-29  1466  	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
554c0a3abf216c Hans de Goede   2017-03-29  1467  	struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
554c0a3abf216c Hans de Goede   2017-03-29  1468  	u8 *pframe = precv_frame->u.hdr.rx_data;
554c0a3abf216c Hans de Goede   2017-03-29  1469  
554c0a3abf216c Hans de Goede   2017-03-29  1470  	/* check A3 */
554c0a3abf216c Hans de Goede   2017-03-29  1471  	if (memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))
554c0a3abf216c Hans de Goede   2017-03-29  1472  		return _SUCCESS;
554c0a3abf216c Hans de Goede   2017-03-29  1473  
554c0a3abf216c Hans de Goede   2017-03-29  1474  	reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN));
554c0a3abf216c Hans de Goede   2017-03-29  1475  
0ad02fa8b90a87 Georgiana Chelu 2017-09-22  1476  	if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
554c0a3abf216c Hans de Goede   2017-03-29  1477  		struct sta_info *psta;
554c0a3abf216c Hans de Goede   2017-03-29  1478  		struct sta_priv *pstapriv = &padapter->stapriv;
554c0a3abf216c Hans de Goede   2017-03-29  1479  
554c0a3abf216c Hans de Goede   2017-03-29  1480  		/* rtw_free_stainfo(padapter, psta); */
554c0a3abf216c Hans de Goede   2017-03-29  1481  
79df841b435018 Fabio Aiuto     2021-04-15  1482  		netdev_dbg(padapter->pnetdev,
79df841b435018 Fabio Aiuto     2021-04-15  1483  			   "ap recv deauth reason code(%d) sta:%pM\n", reason,
79df841b435018 Fabio Aiuto     2021-04-15  1484  			   GetAddr2Ptr(pframe));
554c0a3abf216c Hans de Goede   2017-03-29  1485  
554c0a3abf216c Hans de Goede   2017-03-29  1486  		psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
554c0a3abf216c Hans de Goede   2017-03-29  1487  		if (psta) {
554c0a3abf216c Hans de Goede   2017-03-29  1488  			u8 updated = false;
554c0a3abf216c Hans de Goede   2017-03-29  1489  
554c0a3abf216c Hans de Goede   2017-03-29  1490  			spin_lock_bh(&pstapriv->asoc_list_lock);
554c0a3abf216c Hans de Goede   2017-03-29  1491  			if (list_empty(&psta->asoc_list) == false) {
554c0a3abf216c Hans de Goede   2017-03-29  1492  				list_del_init(&psta->asoc_list);
554c0a3abf216c Hans de Goede   2017-03-29  1493  				pstapriv->asoc_list_cnt--;
554c0a3abf216c Hans de Goede   2017-03-29  1494  				updated = ap_free_sta(padapter, psta, false, reason);
554c0a3abf216c Hans de Goede   2017-03-29  1495  
554c0a3abf216c Hans de Goede   2017-03-29  1496  			}
554c0a3abf216c Hans de Goede   2017-03-29  1497  			spin_unlock_bh(&pstapriv->asoc_list_lock);
554c0a3abf216c Hans de Goede   2017-03-29  1498  
554c0a3abf216c Hans de Goede   2017-03-29  1499  			associated_clients_update(padapter, updated);
554c0a3abf216c Hans de Goede   2017-03-29  1500  		}
554c0a3abf216c Hans de Goede   2017-03-29  1501  
554c0a3abf216c Hans de Goede   2017-03-29  1502  
554c0a3abf216c Hans de Goede   2017-03-29  1503  		return _SUCCESS;
ed0a6d578663ac Sevinj Aghayeva 2022-04-01  1504  	}
554c0a3abf216c Hans de Goede   2017-03-29 @1505  	int	ignore_received_deauth = 0;
554c0a3abf216c Hans de Goede   2017-03-29  1506  
554c0a3abf216c Hans de Goede   2017-03-29  1507  	/* 	Commented by Albert 20130604 */
554c0a3abf216c Hans de Goede   2017-03-29  1508  	/* 	Before sending the auth frame to start the STA/GC mode connection with AP/GO, */
554c0a3abf216c Hans de Goede   2017-03-29  1509  	/* 	we will send the deauth first. */
554c0a3abf216c Hans de Goede   2017-03-29  1510  	/* 	However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. */
554c0a3abf216c Hans de Goede   2017-03-29  1511  	/* 	Added the following code to avoid this case. */
554c0a3abf216c Hans de Goede   2017-03-29  1512  	if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) ||
554c0a3abf216c Hans de Goede   2017-03-29  1513  		(pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) {
554c0a3abf216c Hans de Goede   2017-03-29  1514  		if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) {
554c0a3abf216c Hans de Goede   2017-03-29  1515  			ignore_received_deauth = 1;
a8be3a14951eb8 Sevinj Aghayeva 2022-04-01  1516  		} else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) {
554c0a3abf216c Hans de Goede   2017-03-29  1517  			/*  TODO: 802.11r */
554c0a3abf216c Hans de Goede   2017-03-29  1518  			ignore_received_deauth = 1;
554c0a3abf216c Hans de Goede   2017-03-29  1519  		}
554c0a3abf216c Hans de Goede   2017-03-29  1520  	}
554c0a3abf216c Hans de Goede   2017-03-29  1521  
79df841b435018 Fabio Aiuto     2021-04-15  1522  	netdev_dbg(padapter->pnetdev,
79df841b435018 Fabio Aiuto     2021-04-15  1523  		"sta recv deauth reason code(%d) sta:%pM, ignore = %d\n",
79df841b435018 Fabio Aiuto     2021-04-15  1524  		reason, GetAddr3Ptr(pframe),
79df841b435018 Fabio Aiuto     2021-04-15  1525  		ignore_received_deauth);
554c0a3abf216c Hans de Goede   2017-03-29  1526  
a8be3a14951eb8 Sevinj Aghayeva 2022-04-01  1527  	if (ignore_received_deauth == 0)
554c0a3abf216c Hans de Goede   2017-03-29  1528  		receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
ed0a6d578663ac Sevinj Aghayeva 2022-04-01  1529  
554c0a3abf216c Hans de Goede   2017-03-29  1530  	pmlmepriv->LinkDetectInfo.bBusyTraffic = false;
554c0a3abf216c Hans de Goede   2017-03-29  1531  	return _SUCCESS;
554c0a3abf216c Hans de Goede   2017-03-29  1532  

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ