diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-12-03 17:50:11 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-27 16:50:04 +0300 |
commit | bd8e3189b85c9bac3dfe8a46b97c1c51d203d77a (patch) | |
tree | db2c758b7cc82505b0cef689795adb39c63d69e0 /drivers/mailbox | |
parent | 20d1be36cdef3d1ca9b074da7bc1e4d49b32463f (diff) | |
download | linux-bd8e3189b85c9bac3dfe8a46b97c1c51d203d77a.tar.xz |
mailbox: ti-msgmgr: Off by one in ti_msgmgr_of_xlate()
[ Upstream commit 78f3ff524fca63e7d2a57149a34ade23d2c12798 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mailbox')
-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 5bceafbf6699..01e9e462512b 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, } if (d->is_sproxy) { - if (req_pid > d->num_valid_queues) + if (req_pid >= d->num_valid_queues) goto err; qinst = &inst->qinsts[req_pid]; return qinst->chan; |