All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libertas: fix signedness bug in lbs_auth_to_authtype()
@ 2012-03-28 18:38 Kiran Divekar
  2012-04-16 17:29 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Kiran Divekar @ 2012-03-28 18:38 UTC (permalink / raw)
  To: libertas-dev
  Cc: linux-wireless, Dan Williams, Dan Carpenter, Amitkumar Karwar,
	Kiran Divekar, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

Return type for lbs_auth_to_authtype() is changed from "u8" to
"int" to return negative error code correctly.
Also an error check is added in connect handler for invalid auth
type.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
---
 drivers/net/wireless/libertas/cfg.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 3fa1ece..2fa879b 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -103,7 +103,7 @@ static const u32 cipher_suites[] = {
  * Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1
  * in the firmware spec
  */
-static u8 lbs_auth_to_authtype(enum nl80211_auth_type auth_type)
+static int lbs_auth_to_authtype(enum nl80211_auth_type auth_type)
 {
 	int ret = -ENOTSUPP;
 
@@ -1411,7 +1411,12 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
 		goto done;
 	}
 
-	lbs_set_authtype(priv, sme);
+	ret = lbs_set_authtype(priv, sme);
+	if (ret == -ENOTSUPP) {
+		wiphy_err(wiphy, "unsupported authtype 0x%x\n", sme->auth_type);
+		goto done;
+	}
+
 	lbs_set_radio(priv, preamble, 1);
 
 	/* Do the actual association */
-- 
1.7.0.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libertas: fix signedness bug in lbs_auth_to_authtype()
  2012-03-28 18:38 [PATCH] libertas: fix signedness bug in lbs_auth_to_authtype() Kiran Divekar
@ 2012-04-16 17:29 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2012-04-16 17:29 UTC (permalink / raw)
  To: Kiran Divekar
  Cc: libertas-dev, linux-wireless, Amitkumar Karwar, Dan Carpenter

On Wed, 2012-03-28 at 11:38 -0700, Kiran Divekar wrote:
> From: Amitkumar Karwar <akarwar@marvell.com>
> 
> Return type for lbs_auth_to_authtype() is changed from "u8" to
> "int" to return negative error code correctly.
> Also an error check is added in connect handler for invalid auth
> type.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Kiran Divekar <dkiran@marvell.com>

Acked-by: Dan Williams <dcbw@redhat.com>

> ---
>  drivers/net/wireless/libertas/cfg.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
> index 3fa1ece..2fa879b 100644
> --- a/drivers/net/wireless/libertas/cfg.c
> +++ b/drivers/net/wireless/libertas/cfg.c
> @@ -103,7 +103,7 @@ static const u32 cipher_suites[] = {
>   * Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1
>   * in the firmware spec
>   */
> -static u8 lbs_auth_to_authtype(enum nl80211_auth_type auth_type)
> +static int lbs_auth_to_authtype(enum nl80211_auth_type auth_type)
>  {
>  	int ret = -ENOTSUPP;
>  
> @@ -1411,7 +1411,12 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
>  		goto done;
>  	}
>  
> -	lbs_set_authtype(priv, sme);
> +	ret = lbs_set_authtype(priv, sme);
> +	if (ret == -ENOTSUPP) {
> +		wiphy_err(wiphy, "unsupported authtype 0x%x\n", sme->auth_type);
> +		goto done;
> +	}
> +
>  	lbs_set_radio(priv, preamble, 1);
>  
>  	/* Do the actual association */



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-16 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28 18:38 [PATCH] libertas: fix signedness bug in lbs_auth_to_authtype() Kiran Divekar
2012-04-16 17:29 ` Dan Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.