Commit 78f3ff52 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jassi Brar

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: a2b79838 ("mailbox: ti-msgmgr: Add support for Secure Proxy")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarNishanth Menon <nm@ti.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 2e4ac7cc
...@@ -547,7 +547,7 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox, ...@@ -547,7 +547,7 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox,
} }
if (d->is_sproxy) { if (d->is_sproxy) {
if (req_pid > d->num_valid_queues) if (req_pid >= d->num_valid_queues)
goto err; goto err;
qinst = &inst->qinsts[req_pid]; qinst = &inst->qinsts[req_pid];
return qinst->chan; return qinst->chan;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment