summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Clayton <stillcompiling@gmail.com>2015-08-05 17:17:14 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-07 15:12:40 -0700
commit5dab10f444774dd119e3c370cd332df9c1c646c7 (patch)
tree9027a334f46ddeb76bda58d69d41e383d51cc9ea
parent8a1d7b09e7e3c2c7097712331ac64ccfdbcf8f6d (diff)
downloadop-kernel-dev-5dab10f444774dd119e3c370cd332df9c1c646c7.zip
op-kernel-dev-5dab10f444774dd119e3c370cd332df9c1c646c7.tar.gz
staging: rtl8712: fix buggy size calculation
r8712_get_ndis_wlan_bssid_ex_sz has a "6 * sizeof(unsigned long)" where the underlying struct has a 6 * unsigned char. Simplify the calculation by just subtracting the variable part from the size of the struct. This also gets rid of a use of typedef NDIS_802_11_RATES_EX Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rtl8712/rtl871x_mlme.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
index c044b0e..6b3451f 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -210,17 +210,7 @@ void r8712_generate_random_ibss(u8 *pibss)
uint r8712_get_ndis_wlan_bssid_ex_sz(struct ndis_wlan_bssid_ex *bss)
{
- uint t_len;
-
- t_len = sizeof(u32) + 6 * sizeof(unsigned long) + 2 +
- sizeof(struct ndis_802_11_ssid) + sizeof(u32) +
- sizeof(s32) +
- sizeof(enum NDIS_802_11_NETWORK_TYPE) +
- sizeof(struct NDIS_802_11_CONFIGURATION) +
- sizeof(enum NDIS_802_11_NETWORK_INFRASTRUCTURE) +
- sizeof(NDIS_802_11_RATES_EX) +
- sizeof(u32) + bss->IELength;
- return t_len;
+ return sizeof(*bss) + bss->IELength - MAX_IE_SZ;
}
u8 *r8712_get_capability_from_ie(u8 *ie)
OpenPOWER on IntegriCloud