* [PATCH] iwlwifi: pcie: off by one in iwl_trans_pcie_dyn_txq_alloc()
@ 2017-04-21 19:46 Dan Carpenter
2017-04-21 19:59 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2017-04-21 19:46 UTC (permalink / raw)
To: Johannes Berg, Sara Sharon
Cc: Emmanuel Grumbach, Luca Coelho, Intel Linux Wireless, Kalle Valo,
linux-wireless, kernel-janitors
The > should be >= or we are writing one space beyond the end of the
array.
Fixes: 310181ec34e2 ("iwlwifi: move to TVQM mode")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
index 9fb46a6f47cf..295331558108 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
@@ -912,7 +912,7 @@ int iwl_trans_pcie_dyn_txq_alloc(struct iwl_trans *trans,
rsp = (void *)hcmd.resp_pkt->data;
qid = le16_to_cpu(rsp->queue_number);
- if (qid > ARRAY_SIZE(trans_pcie->txq)) {
+ if (qid >= ARRAY_SIZE(trans_pcie->txq)) {
WARN_ONCE(1, "queue index %d unsupported", qid);
ret = -EIO;
goto error;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] iwlwifi: pcie: off by one in iwl_trans_pcie_dyn_txq_alloc()
2017-04-21 19:46 [PATCH] iwlwifi: pcie: off by one in iwl_trans_pcie_dyn_txq_alloc() Dan Carpenter
@ 2017-04-21 19:59 ` Johannes Berg
2017-04-21 20:12 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2017-04-21 19:59 UTC (permalink / raw)
To: Dan Carpenter, Sara Sharon
Cc: Emmanuel Grumbach, Luca Coelho, Intel Linux Wireless, Kalle Valo,
linux-wireless, kernel-janitors
On Fri, 2017-04-21 at 22:46 +0300, Dan Carpenter wrote:
> The > should be >= or we are writing one space beyond the end of the
> array.
I think I just did the same fixes you did - after running smatch :)
This is on its way already (in our local tree), but since nobody can
actually run the code yet - the hardware doesn't exist - Luca hasn't
sent it out yet.
Thanks though!
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iwlwifi: pcie: off by one in iwl_trans_pcie_dyn_txq_alloc()
2017-04-21 19:59 ` Johannes Berg
@ 2017-04-21 20:12 ` Dan Carpenter
2017-04-22 7:02 ` Coelho, Luciano
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2017-04-21 20:12 UTC (permalink / raw)
To: Johannes Berg
Cc: Sara Sharon, Emmanuel Grumbach, Luca Coelho, Intel Linux Wireless,
Kalle Valo, linux-wireless, kernel-janitors
Heh. I raced this one through to see if I could beat you to the punch.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iwlwifi: pcie: off by one in iwl_trans_pcie_dyn_txq_alloc()
2017-04-21 20:12 ` Dan Carpenter
@ 2017-04-22 7:02 ` Coelho, Luciano
2017-04-22 9:42 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Coelho, Luciano @ 2017-04-22 7:02 UTC (permalink / raw)
To: dan.carpenter@oracle.com, johannes@sipsolutions.net
Cc: linuxwifi, kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
Sharon, Sara, Grumbach, Emmanuel, kernel-janitors@vger.kernel.org
T24gRnJpLCAyMDE3LTA0LTIxIGF0IDIzOjEyICswMzAwLCBEYW4gQ2FycGVudGVyIHdyb3RlOg0K
PiBIZWguICBJIHJhY2VkIHRoaXMgb25lIHRocm91Z2ggdG8gc2VlIGlmIEkgY291bGQgYmVhdCB5
b3UgdG8gdGhlIHB1bmNoLg0KDQpZZWFoLCB0aGlzIHBhdGNoIGlzIGluIG91ciBpbnRlcm5hbCB0
cmVlLiAgQnV0IG1heWJlIHdlIGNhbiB0YWtlIERhbidzDQpmb3IgdXBzdHJlYW0gZm9yIGhpcyBl
ZmZvcnRzPyA6KQ0KDQotLQ0KQ2hlZXJzLA0KTHVjYS4=
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iwlwifi: pcie: off by one in iwl_trans_pcie_dyn_txq_alloc()
2017-04-22 7:02 ` Coelho, Luciano
@ 2017-04-22 9:42 ` Dan Carpenter
0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2017-04-22 9:42 UTC (permalink / raw)
To: Coelho, Luciano
Cc: johannes@sipsolutions.net, linuxwifi, kvalo@codeaurora.org,
linux-wireless@vger.kernel.org, Sharon, Sara, Grumbach, Emmanuel,
kernel-janitors@vger.kernel.org
On Sat, Apr 22, 2017 at 07:02:23AM +0000, Coelho, Luciano wrote:
> On Fri, 2017-04-21 at 23:12 +0300, Dan Carpenter wrote:
> > Heh. I raced this one through to see if I could beat you to the punch.
>
> Yeah, this patch is in our internal tree. But maybe we can take Dan's
> for upstream for his efforts? :)
No no.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-04-22 9:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-21 19:46 [PATCH] iwlwifi: pcie: off by one in iwl_trans_pcie_dyn_txq_alloc() Dan Carpenter
2017-04-21 19:59 ` Johannes Berg
2017-04-21 20:12 ` Dan Carpenter
2017-04-22 7:02 ` Coelho, Luciano
2017-04-22 9:42 ` Dan Carpenter
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).