diff options
| author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-12-03 09:50:11 -0500 |
|---|---|---|
| committer | Jassi Brar <jaswinder.singh@linaro.org> | 2018-12-11 21:32:45 -0500 |
| commit | 78f3ff524fca63e7d2a57149a34ade23d2c12798 (patch) | |
| tree | 71056372c0fe21c69a9e79ef445fbdd5a1f1279e | |
| parent | 2e4ac7cc493f36e45facb921a992a145351d280c (diff) | |
mailbox: ti-msgmgr: Off by one in ti_msgmgr_of_xlate()
The > comparison should be >= or we access one element beyond the end
of the array.
(The inst->qinsts[] array is allocated in the ti_msgmgr_probe() function
and it has ->num_valid_queues elements.)
Fixes: a2b79838b891 ("mailbox: ti-msgmgr: Add support for Secure Proxy")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
| -rw-r--r-- | drivers/mailbox/ti-msgmgr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mailbox/ti-msgmgr.c b/drivers/mailbox/ti-msgmgr.c index 713d701b6568..6f6addd51d14 100644 --- a/drivers/mailbox/ti-msgmgr.c +++ b/drivers/mailbox/ti-msgmgr.c | |||
| @@ -547,7 +547,7 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox, | |||
| 547 | } | 547 | } |
| 548 | 548 | ||
| 549 | if (d->is_sproxy) { | 549 | if (d->is_sproxy) { |
| 550 | if (req_pid > d->num_valid_queues) | 550 | if (req_pid >= d->num_valid_queues) |
| 551 | goto err; | 551 | goto err; |
| 552 | qinst = &inst->qinsts[req_pid]; | 552 | qinst = &inst->qinsts[req_pid]; |
| 553 | return qinst->chan; | 553 | return qinst->chan; |
