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]
Date:	Wed, 8 Jul 2015 14:17:42 +0000
From:	"Sharon, Sara" <sara.sharon@...el.com>
To:	'Nicholas Krause' <xerofoify@...il.com>,
	"Berg, Johannes" <johannes.berg@...el.com>
CC:	"Grumbach, Emmanuel" <emmanuel.grumbach@...el.com>,
	"ilw@...ux.intel.com" <ilw@...ux.intel.com>,
	"kvalo@...eaurora.org" <kvalo@...eaurora.org>,
	"Altman, Avri" <avri.altman@...el.com>,
	"Kaufman, Liad" <liad.kaufman@...el.com>,
	"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] iwlwifi:Add increment statement for a  for loop in the
 function iwl_pcie_rx_allocator

> This removes the incrementing of the variable i at the end of the
> function iwl_pcie_rx_allocator's for loop into the for loop statement
> by adding the increment statement of i++ at the end of the for loop
> declaration in order to improve readablitiy of this for loop's
> declaration in the function iwl_pcie_rx_allocator.
> 
> Signed-off-by: Nicholas Krause <xerofoify@...il.com>
> ---
>  drivers/net/wireless/iwlwifi/pcie/rx.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c
> b/drivers/net/wireless/iwlwifi/pcie/rx.c
> index a3fbaa0..a26609c 100644
> --- a/drivers/net/wireless/iwlwifi/pcie/rx.c
> +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
> @@ -441,7 +441,7 @@ static void iwl_pcie_rx_allocator(struct iwl_trans
> *trans)
>  		list_replace_init(&rba->rbd_empty, &local_empty);
>  		spin_unlock(&rba->lock);
> 
> -		for (i = 0; i < RX_CLAIM_REQ_ALLOC;) {
> +		for (i = 0; i < RX_CLAIM_REQ_ALLOC; i++) {
>  			struct iwl_rx_mem_buffer *rxb;
>  			struct page *page;
> 

This is wrong in the error flows. Please note the continue statements in the code.
It is important that the loop counter will not be incremented in those cases, or your kernel will panic.

> @@ -478,7 +478,6 @@ static void iwl_pcie_rx_allocator(struct iwl_trans
> *trans)
> 
>  			/* move the allocated entry to the out list */
>  			list_move(&rxb->list, &local_allocated);
> -			i++;
>  		}
> 
>  		spin_lock(&rba->lock);
> --
> 2.1.4

---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ