summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/src/wlan_hdd_p2p.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c
index e6066b5d274f..30b0180f8398 100644
--- a/core/hdd/src/wlan_hdd_p2p.c
+++ b/core/hdd/src/wlan_hdd_p2p.c
@@ -1130,7 +1130,7 @@ __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
(cfgState->remain_on_chan_ctx->cookie != cookie)) {
mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
hdd_err("No Remain on channel pending with specified cookie value");
- return 0;
+ return -EINVAL;
}
if (NULL != cfgState->remain_on_chan_ctx) {
@@ -1553,11 +1553,14 @@ send_frame:
mutex_lock(&cfgState->remain_on_chan_ctx_lock);
- *cookie = (uintptr_t) cfgState->buf;
- cfgState->action_cookie = *cookie;
- if (cfgState->remain_on_chan_ctx)
- cfgState->remain_on_chan_ctx->cookie =
- cfgState->action_cookie;
+ if (cfgState->remain_on_chan_ctx) {
+ cfgState->action_cookie =
+ cfgState->remain_on_chan_ctx->cookie;
+ *cookie = cfgState->action_cookie;
+ } else {
+ *cookie = (uintptr_t) cfgState->buf;
+ cfgState->action_cookie = *cookie;
+ }
mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
}