Commit 1eb6635c authored by Jayan John's avatar Jayan John Committed by Hari Kanigeri

SYSLINK: ipc - fixes in messageq and nameserver_remotenotify

This patch fixes the issues found in..
	-messageq.c: messageq_open() now returns standard Linux
		error -NOENT instead of MESSAGEQ_E_NOTFOUND.
	-nameserver_remotenotify.c: nameserver_remotenotify_get()
		calls  gatepeterson_leave() in the case of failure.
Signed-off-by: default avatarJayan John <x00jayan@ti.com>
parent 965600b4
......@@ -772,12 +772,13 @@ int messageq_open(char *name, u32 *queue_id)
len = nameserver_get(messageq_state.ns_handle, name, queue_id,
sizeof(u32), NULL);
if (len < 0) {
if (len == -ENOENT)
if (len == -ENOENT) {
/* Name not found */
status = MESSAGEQ_E_NOTFOUND;
else
status = -ENOENT;
} else {
/* Any other error from nameserver */
status = len;
}
}
exit:
......
......@@ -280,6 +280,7 @@ void nameserver_remotenotify_callback(u16 proc_id, u32 event_no,
memcpy(&(handle->msg[1 - offset]->value_buf), &value,
handle->msg[1 - offset]->value_len);
}
/* Send a response back */
handle->msg[1 - offset]->response = true;
handle->msg[1 - offset]->request = false;
......@@ -355,6 +356,7 @@ int nameserver_remotenotify_get(void *rhandle,
goto notify_error;
gatepeterson_leave(obj->params.gate, key);
/* Pend on the semaphore */
retval = down_interruptible(obj->sem_handle);
if (retval) {
......@@ -365,12 +367,12 @@ int nameserver_remotenotify_get(void *rhandle,
key = gatepeterson_enter(obj->params.gate);
if (obj->msg[offset]->request_status != true) {
retval = -ENOENT;
goto exit;
goto request_error;
}
if (!value_len) {
retval = -ENOENT;
goto exit;
goto request_error;
}
if (value_len == sizeof(u32))
......@@ -386,8 +388,8 @@ int nameserver_remotenotify_get(void *rhandle,
retval = value_len;
notify_error:
request_error:
gatepeterson_leave(obj->params.gate, key);
exit:
return retval;
}
......
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