From: John Crispin <john@phrozen.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: ath11k@lists.infradead.org, John Crispin <john@phrozen.org>
Subject: [PATCH] ath11k: fix mac_cap_info copy size
Date: Wed, 19 Jun 2019 07:32:08 +0200 [thread overview]
Message-ID: <20190619053208.17243-1-john@phrozen.org> (raw)
The code currently copies the he_cap field when adding a peer from a six
byte to an eight byte buffer. Switch from using the dest buffer length to
that of the src buffer. Also make sure that the trailing 2 bytes are
zero'ed out.
Signed-off-by: John Crispin <john@phrozen.org>
---
drivers/net/wireless/ath/ath11k/mac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 53177a9e3c7e..7239013b59ca 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -1262,8 +1262,9 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar,
arg->he_flag = true;
+ memset(&arg->peer_he_cap_macinfo, 0, sizeof(&arg->peer_he_cap_macinfo));
memcpy(&arg->peer_he_cap_macinfo, he_cap->he_cap_elem.mac_cap_info,
- sizeof(arg->peer_he_cap_macinfo));
+ sizeof(he_cap->he_cap_elem.mac_cap_info));
memcpy(&arg->peer_he_cap_phyinfo, he_cap->he_cap_elem.phy_cap_info,
sizeof(arg->peer_he_cap_phyinfo));
memcpy(&arg->peer_he_ops, &vif->bss_conf.he_operation,
--
2.20.1
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
next reply other threads:[~2019-06-19 5:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-19 5:32 John Crispin [this message]
2019-06-19 6:11 ` [PATCH] ath11k: fix mac_cap_info copy size John Crispin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190619053208.17243-1-john@phrozen.org \
--to=john@phrozen.org \
--cc=ath11k@lists.infradead.org \
--cc=kvalo@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox