Commit 99f4b198 authored by Jayan John's avatar Jayan John Committed by Hari Kanigeri

SYSLINK: ipc - fix messageq create and delete

This patch fixes messageq_create and delete functions.
It removes the BUG_ON check for NULL name in message_create.
In messageq_delete, it removes name from nameserver and frees
memory for name only if name is not NULL.
Signed-off-by: default avatarJayan John <x00jayan@ti.com>
parent b5beb241
...@@ -557,7 +557,6 @@ void *messageq_create(char *name, const struct messageq_params *params) ...@@ -557,7 +557,6 @@ void *messageq_create(char *name, const struct messageq_params *params)
gt_2trace(messageq_dbgmask, GT_ENTER, "messageq_create", name, params); gt_2trace(messageq_dbgmask, GT_ENTER, "messageq_create", name, params);
BUG_ON(name == NULL);
BUG_ON(params == NULL); BUG_ON(params == NULL);
if (atomic_cmpmask_and_lt(&(messageq_state.ref_count), if (atomic_cmpmask_and_lt(&(messageq_state.ref_count),
MESSAGEQ_MAKE_MAGICSTAMP(0), MESSAGEQ_MAKE_MAGICSTAMP(0),
...@@ -711,12 +710,14 @@ int messageq_delete(void **msg_handleptr) ...@@ -711,12 +710,14 @@ int messageq_delete(void **msg_handleptr)
/* Take the local lock */ /* Take the local lock */
key = mutex_lock_interruptible(messageq_state.gate_handle); key = mutex_lock_interruptible(messageq_state.gate_handle);
if (handle->name != NULL) {
/* remove from the name serve */ /* remove from the name serve */
nameserver_remove(messageq_state.ns_handle, handle->name); nameserver_remove(messageq_state.ns_handle, handle->name);
if (handle->name != NULL) {
/* Free memory for the name */ /* Free memory for the name */
kfree(handle->name); kfree(handle->name);
} }
/* Release the local lock */ /* Release the local lock */
mutex_unlock(messageq_state.gate_handle); mutex_unlock(messageq_state.gate_handle);
......
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