提交 effcc625 编写于 作者: A Amitkumar Karwar 提交者: John W. Linville

libertas: fix signedness bug in lbs_auth_to_authtype()

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: NKiran Divekar <dkiran@marvell.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 b4838d12
...@@ -103,7 +103,7 @@ static const u32 cipher_suites[] = { ...@@ -103,7 +103,7 @@ static const u32 cipher_suites[] = {
* Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1 * Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1
* in the firmware spec * 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; int ret = -ENOTSUPP;
...@@ -1411,7 +1411,12 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1411,7 +1411,12 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
goto done; 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); lbs_set_radio(priv, preamble, 1);
/* Do the actual association */ /* Do the actual association */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册