From: Dan Carpenter <dan.carpenter@oracle.com>
To: srirrama@codeaurora.org
Cc: ath10k@lists.infradead.org
Subject: [bug report] ath10k: add support for configuring management packet rate
Date: Wed, 10 Oct 2018 13:49:59 +0300 [thread overview]
Message-ID: <20181010104959.GA16248@mwanda> (raw)
Hello Sriram R,
The patch f279294e9ee2: "ath10k: add support for configuring
management packet rate" from Sep 10, 2018, leads to the following
static checker warning:
drivers/net/wireless/ath/ath10k/mac.c:168 ath10k_mac_get_rate_hw_value()
error: buffer overflow 'ath10k_rates' 12 <= 143
drivers/net/wireless/ath/ath10k/mac.c
159 static int ath10k_mac_get_rate_hw_value(int bitrate)
160 {
161 int i;
162 u8 hw_value_prefix = 0;
163
164 if (ath10k_mac_bitrate_is_cck(bitrate))
165 hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
166
167 for (i = 0; i < sizeof(ath10k_rates); i++) {
^^^^^^^^^^^^^^^^^^^^
Should be ARRAY_SIZE() instead of sizeof().
168 if (ath10k_rates[i].bitrate == bitrate)
169 return hw_value_prefix | ath10k_rates[i].hw_value;
170 }
171
172 return -EINVAL;
173 }
174
regards,
dan carpenter
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
next reply other threads:[~2018-10-10 10:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-10 10:49 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-10-10 11:00 [bug report] ath10k: add support for configuring management packet rate Dan Carpenter
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=20181010104959.GA16248@mwanda \
--to=dan.carpenter@oracle.com \
--cc=ath10k@lists.infradead.org \
--cc=srirrama@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.