[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@gmail.com>
Date: Mon, 27 Jul 2015 21:41:10 -0700
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] 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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
From: Joshua Clayton <stillcompiling@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Nitin Kuppelur <nitinkuppelur@...il.com>,
Joshua Clayton <stillcompiling@...il.com>,
Vaishali Thakkar <vthakkar1994@...il.com>,
Tapasweni Pathak <tapaswenipathak@...il.com>,
Daniel Baluta <daniel.baluta@...el.com>,
Melike Yurtoglu <aysemelikeyurtoglu@...il.com>,
Max Perepelitsyn <mperepelitsyn@...il.com>,
Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
Cristina Opriceana <cristina.opriceana@...il.com>,
Dogukan Ergun <dogukan.ergun@...il.com>,
Julia Lawall <Julia.Lawall@...6.fr>,
Dan Carpenter <dan.carpenter@...cle.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH V3 1/8] staging: rtl8712: fix buggy size calculation
Date: Mon, 27 Jul 2015 21:41:10 -0700
Message-Id: <305999598d7738feabdc8e5df5400b3e7be7f5ed.1438057939.git.stillcompiling@...il.com>
X-Mailer: git-send-email 2.4.6
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
In-Reply-To: <cover.1438057939.git.stillcompiling@...il.com>
References: <cover.1438057939.git.stillcompiling@...il.com>
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@...il.com>
---
drivers/staging/rtl8712/rtl871x_mlme.c | 12 +-----------
1 file changed, 1 insertion(+), 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)
--
2.4.6
--
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