diff mbox

mwifiex: memory corruption in mwifiex_tdls_add_vht_capab()

Message ID 20140214090312.GB13684@elgon.mountain (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Dan Carpenter Feb. 14, 2014, 9:03 a.m. UTC
There is a typo here because the names are confusingly similar.  The
intent was sizeof(struct ieee80211_vht_cap) (size 12) but sizeof(struct
ieee80211_ht_cap) (size 32) was used.

Anway, it's cleaner to just specify the variable instead of the type.

Fixes: 5f6d5983394f ('mwifiex: add VHT support for TDLS')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Bing Zhao Feb. 15, 2014, 3:02 a.m. UTC | #1
Hi Dan,

Thanks for the patch.

> There is a typo here because the names are confusingly similar.  The
> intent was sizeof(struct ieee80211_vht_cap) (size 12) but sizeof(struct
> ieee80211_ht_cap) (size 32) was used.
> 
> Anway, it's cleaner to just specify the variable instead of the type.
> 
> Fixes: 5f6d5983394f ('mwifiex: add VHT support for TDLS')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Bing Zhao <bzhao@marvell.com>

Thanks,
Bing

> 
> diff --git a/drivers/net/wireless/mwifiex/tdls.c b/drivers/net/wireless/mwifiex/tdls.c
> index 5efd456af571..9d6849f60603 100644
> --- a/drivers/net/wireless/mwifiex/tdls.c
> +++ b/drivers/net/wireless/mwifiex/tdls.c
> @@ -180,7 +180,7 @@ static int mwifiex_tdls_add_vht_capab(struct mwifiex_private *priv,
>  	memset(&vht_cap, 0, sizeof(struct ieee80211_vht_cap));
> 
>  	mwifiex_fill_vht_cap_tlv(priv, &vht_cap, priv->curr_bss_params.band);
> -	memcpy(pos, &vht_cap, sizeof(struct ieee80211_ht_cap));
> +	memcpy(pos, &vht_cap, sizeof(vht_cap));
> 
>  	return 0;
>  }
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/mwifiex/tdls.c b/drivers/net/wireless/mwifiex/tdls.c
index 5efd456af571..9d6849f60603 100644
--- a/drivers/net/wireless/mwifiex/tdls.c
+++ b/drivers/net/wireless/mwifiex/tdls.c
@@ -180,7 +180,7 @@  static int mwifiex_tdls_add_vht_capab(struct mwifiex_private *priv,
 	memset(&vht_cap, 0, sizeof(struct ieee80211_vht_cap));
 
 	mwifiex_fill_vht_cap_tlv(priv, &vht_cap, priv->curr_bss_params.band);
-	memcpy(pos, &vht_cap, sizeof(struct ieee80211_ht_cap));
+	memcpy(pos, &vht_cap, sizeof(vht_cap));
 
 	return 0;
 }