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: <20140709102603.GV25880@mwanda>
Date:	Wed, 9 Jul 2014 13:26:03 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Michalis Pappas <mpappas@...tmail.fm>
Cc:	gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2] staging: gdm72xx: move T_CAPABILITY definitions to
 hci.h

On Wed, Jul 02, 2014 at 11:18:07AM +0100, Michalis Pappas wrote:
> Signed-off-by: Michalis Pappas <mpappas@...tmail.fm>
> ---
>  drivers/staging/gdm72xx/gdm_wimax.c | 11 ++++-------
>  drivers/staging/gdm72xx/hci.h       |  6 ++++++
>  2 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
> index 4148013..50b7bf0 100644
> --- a/drivers/staging/gdm72xx/gdm_wimax.c
> +++ b/drivers/staging/gdm72xx/gdm_wimax.c
> @@ -609,10 +609,7 @@ static void gdm_wimax_prepare_device(struct net_device *dev)
>  	u16 len = 0;
>  	u32 val = 0;
>  
> -	#define BIT_MULTI_CS	0
> -	#define BIT_WIMAX		1
> -	#define BIT_QOS			2
> -	#define BIT_AGGREGATION	3
> +
>  
>  	/* GetInformation mac address */
>  	len = 0;
> @@ -621,12 +618,12 @@ static void gdm_wimax_prepare_device(struct net_device *dev)
>  	hci->length = H2B(len);
>  	gdm_wimax_send(nic, hci, HCI_HEADER_SIZE+len);
>  
> -	val = (1<<BIT_WIMAX) | (1<<BIT_MULTI_CS);
> +	val = (1 << T_CAPABILITY_WIMAX) | (1 << T_CAPABILITY_MULTI_CS);

Double shifting here...  It should just be:

	val = T_CAPABILITY_WIMAX | T_CAPABILITY_MULTI_CS;

This bug feels like something a static checker should find.  Let me test
that.

regards,
dan carpenter

--
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