* [PATCH] Add protection to get_expected_throughput opcode
@ 2016-08-11 10:38 Maxim Altshul
2016-08-11 10:38 ` [PATCH] mac80211: " Maxim Altshul
2016-09-04 3:22 ` [PATCH] " Julian Calaby
0 siblings, 2 replies; 5+ messages in thread
From: Maxim Altshul @ 2016-08-11 10:38 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Maxim Altshul
The patch is done with respect to the patch that was applied:
[PATCH v3] mac80211: mesh: Add support for HW RC implementation
1. Patch adds protection as we discussed
2. Patch changes the function call that is made in the mesh patch
to comply with the change.
Maxim Altshul (1):
mac80211: Add protection to get_expected_throughput opcode
net/mac80211/driver-ops.h | 8 ++++----
net/mac80211/sta_info.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
--
2.9.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] mac80211: Add protection to get_expected_throughput opcode
2016-08-11 10:38 [PATCH] Add protection to get_expected_throughput opcode Maxim Altshul
@ 2016-08-11 10:38 ` Maxim Altshul
2016-08-11 12:55 ` Johannes Berg
2016-09-04 3:22 ` [PATCH] " Julian Calaby
1 sibling, 1 reply; 5+ messages in thread
From: Maxim Altshul @ 2016-08-11 10:38 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Maxim Altshul
To protect the opcode we add a check for sta->uploaded.
This is done to prevent a situation where the function gets
called from userspace for example, before sta is uploaded
to driver, causing a crash.
Also, change headers to comply with the change, wherever the
function was called.
Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
---
net/mac80211/driver-ops.h | 8 ++++----
net/mac80211/sta_info.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 1f75195..ec4a690 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1075,13 +1075,13 @@ static inline void drv_leave_ibss(struct ieee80211_local *local,
}
static inline u32 drv_get_expected_throughput(struct ieee80211_local *local,
- struct ieee80211_sta *sta)
+ struct sta_info *sta)
{
u32 ret = 0;
- trace_drv_get_expected_throughput(sta);
- if (local->ops->get_expected_throughput)
- ret = local->ops->get_expected_throughput(&local->hw, sta);
+ trace_drv_get_expected_throughput(&sta->sta);
+ if (local->ops->get_expected_throughput && sta->uploaded)
+ ret = local->ops->get_expected_throughput(&local->hw, &sta->sta);
trace_drv_return_u32(local, ret);
return ret;
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 8860c6c..6624577 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -2108,7 +2108,7 @@ u32 sta_get_expected_throughput(struct sta_info *sta)
if (ref && ref->ops->get_expected_throughput)
thr = ref->ops->get_expected_throughput(sta->rate_ctrl_priv);
else
- thr = drv_get_expected_throughput(local, &sta->sta);
+ thr = drv_get_expected_throughput(local, sta);
return thr;
}
--
2.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: Add protection to get_expected_throughput opcode
2016-08-11 10:38 ` [PATCH] mac80211: " Maxim Altshul
@ 2016-08-11 12:55 ` Johannes Berg
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2016-08-11 12:55 UTC (permalink / raw)
To: Maxim Altshul; +Cc: linux-wireless
On Thu, 2016-08-11 at 13:38 +0300, Maxim Altshul wrote:
> To protect the opcode we add a check for sta->uploaded.
>
Applied, with a reworded commit message - thanks
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Add protection to get_expected_throughput opcode
2016-08-11 10:38 [PATCH] Add protection to get_expected_throughput opcode Maxim Altshul
2016-08-11 10:38 ` [PATCH] mac80211: " Maxim Altshul
@ 2016-09-04 3:22 ` Julian Calaby
2016-09-04 6:24 ` Altshul, Maxim
1 sibling, 1 reply; 5+ messages in thread
From: Julian Calaby @ 2016-09-04 3:22 UTC (permalink / raw)
To: Maxim Altshul; +Cc: Johannes Berg, linux-wireless
Hi Maxim,
On Thu, Aug 11, 2016 at 8:38 PM, Maxim Altshul <maxim.altshul@ti.com> wrote:
> The patch is done with respect to the patch that was applied:
> [PATCH v3] mac80211: mesh: Add support for HW RC implementation
>
> 1. Patch adds protection as we discussed
> 2. Patch changes the function call that is made in the mesh patch
> to comply with the change.
>
> Maxim Altshul (1):
> mac80211: Add protection to get_expected_throughput opcode
>
> net/mac80211/driver-ops.h | 8 ++++----
> net/mac80211/sta_info.c | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
Where's the patch?
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] Add protection to get_expected_throughput opcode
2016-09-04 3:22 ` [PATCH] " Julian Calaby
@ 2016-09-04 6:24 ` Altshul, Maxim
0 siblings, 0 replies; 5+ messages in thread
From: Altshul, Maxim @ 2016-09-04 6:24 UTC (permalink / raw)
To: Julian Calaby; +Cc: Johannes Berg, linux-wireless
PiANCj4gV2hlcmUncyB0aGUgcGF0Y2g/DQo+IA0KWW91IGNhbiBzZWUgaXQgb24gbWFjODAyMTEt
bmV4dC4gDQpDb21taXQgNGZkYmM2N2EyNWNlNTc3Yjc5YjNhZjU5NWU4NzRlOWVmOTIxMzI5Zg0K
DQpNYXgNCj4gDQo+IEVtYWlsOiBqdWxpYW4uY2FsYWJ5QGdtYWlsLmNvbQ0KPiBQcm9maWxlOiBo
dHRwOi8vd3d3Lmdvb2dsZS5jb20vcHJvZmlsZXMvanVsaWFuLmNhbGFieS8NCg0KDQo=
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-09-04 6:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11 10:38 [PATCH] Add protection to get_expected_throughput opcode Maxim Altshul
2016-08-11 10:38 ` [PATCH] mac80211: " Maxim Altshul
2016-08-11 12:55 ` Johannes Berg
2016-09-04 3:22 ` [PATCH] " Julian Calaby
2016-09-04 6:24 ` Altshul, Maxim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).