Commit 9061a5b5 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 903dbe7e
...@@ -772,12 +772,13 @@ int messageq_open(char *name, u32 *queue_id) ...@@ -772,12 +772,13 @@ int messageq_open(char *name, u32 *queue_id)
len = nameserver_get(messageq_state.ns_handle, name, queue_id, len = nameserver_get(messageq_state.ns_handle, name, queue_id,
sizeof(u32), NULL); sizeof(u32), NULL);
if (len < 0) { if (len < 0) {
if (len == -ENOENT) if (len == -ENOENT) {
/* Name not found */ /* Name not found */
status = MESSAGEQ_E_NOTFOUND; status = -ENOENT;
else } else {
/* Any other error from nameserver */ /* Any other error from nameserver */
status = len; status = len;
}
} }
exit: exit:
......
...@@ -280,6 +280,7 @@ void nameserver_remotenotify_callback(u16 proc_id, u32 event_no, ...@@ -280,6 +280,7 @@ void nameserver_remotenotify_callback(u16 proc_id, u32 event_no,
memcpy(&(handle->msg[1 - offset]->value_buf), &value, memcpy(&(handle->msg[1 - offset]->value_buf), &value,
handle->msg[1 - offset]->value_len); handle->msg[1 - offset]->value_len);
} }
/* Send a response back */ /* Send a response back */
handle->msg[1 - offset]->response = true; handle->msg[1 - offset]->response = true;
handle->msg[1 - offset]->request = false; handle->msg[1 - offset]->request = false;
...@@ -355,6 +356,7 @@ int nameserver_remotenotify_get(void *rhandle, ...@@ -355,6 +356,7 @@ int nameserver_remotenotify_get(void *rhandle,
goto notify_error; goto notify_error;
gatepeterson_leave(obj->params.gate, key); gatepeterson_leave(obj->params.gate, key);
/* Pend on the semaphore */ /* Pend on the semaphore */
retval = down_interruptible(obj->sem_handle); retval = down_interruptible(obj->sem_handle);
if (retval) { if (retval) {
...@@ -365,12 +367,12 @@ int nameserver_remotenotify_get(void *rhandle, ...@@ -365,12 +367,12 @@ int nameserver_remotenotify_get(void *rhandle,
key = gatepeterson_enter(obj->params.gate); key = gatepeterson_enter(obj->params.gate);
if (obj->msg[offset]->request_status != true) { if (obj->msg[offset]->request_status != true) {
retval = -ENOENT; retval = -ENOENT;
goto exit; goto request_error;
} }
if (!value_len) { if (!value_len) {
retval = -ENOENT; retval = -ENOENT;
goto exit; goto request_error;
} }
if (value_len == sizeof(u32)) if (value_len == sizeof(u32))
...@@ -386,8 +388,8 @@ int nameserver_remotenotify_get(void *rhandle, ...@@ -386,8 +388,8 @@ int nameserver_remotenotify_get(void *rhandle,
retval = value_len; retval = value_len;
notify_error: notify_error:
request_error:
gatepeterson_leave(obj->params.gate, key); gatepeterson_leave(obj->params.gate, key);
exit: exit:
return retval; 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