summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAngela Stegmaier <angelabaker@ti.com>2010-06-08 12:32:36 -0500
committerRicardo Perez Olivares <x0081762@ti.com>2010-08-31 20:15:48 -0500
commit034c17b474e3abda8a3ee1f2c81d31241b67bd9c (patch)
tree053f8bb7714a5a96e277e61044f9efdc7a1798c5 /drivers
parent8e8f848888e8643ac697530783faa16e29cdba64 (diff)
SYSLINK: ipc- check queue validity in messageq_put
If there has been an MPU-side app failure and the message queue has been deleted, then obj could be NULL in the local put part of messageq_put. So, after setting obj, obj should be checked for NULL-ness before being de-referenced. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dsp/syslink/multicore_ipc/messageq.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/dsp/syslink/multicore_ipc/messageq.c b/drivers/dsp/syslink/multicore_ipc/messageq.c
index 399422ff2b81..87d09996114b 100644
--- a/drivers/dsp/syslink/multicore_ipc/messageq.c
+++ b/drivers/dsp/syslink/multicore_ipc/messageq.c
@@ -1073,6 +1073,11 @@ int messageq_put(u32 queue_id, messageq_msg msg)
/* It is a local MessageQ */
obj = (struct messageq_object *)
(messageq_module->queues[(u16)(queue_id)]);
+ /* Check for MessageQ Validity. */
+ if (obj == NULL) {
+ status = MESSAGEQ_E_INVALIDMSG;
+ goto exit;
+ }
status = mutex_lock_interruptible(messageq_module->gate_handle);
if (status < 0)
goto exit;