Commit b558d615 authored by Suman Anna's avatar Suman Anna Committed by Hari Kanigeri

SYSLINK: ipc - bug fixes for listmp_sharedmemory_open and api_status

This patch fixes the following bugs found during ListMP sample application
testing.
	- listmp_sharedmemory_ioctl_open has an out-of-place
		listmp_sharedmemory_create function call. This is removed.
	- cargs->api_status is not returning a failure value in case of
		premature exit for listmp_sharedmemory_get_head,
		listmp_sharedmemory_get_tail, listmp_sharedmemory_put_head,
		listmp_sharedmemory_put_tail functions.

There are other places where cargs->api_status needs to be fixed and this will
be done in a subsequent patch.
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
parent d382a159
......@@ -244,7 +244,6 @@ static inline int listmp_sharedmemory_ioctl_open(
(u32 *)cargs->args.open.params->shared_addr);
if (unlikely(params.shared_addr == NULL))
goto free_name;
cargs->args.open.listmp_handle = listmp_sharedmemory_create(&params);
status = listmp_sharedmemory_open(&listmp_handle, &params);
if (status)
......@@ -309,6 +308,8 @@ static inline int listmp_sharedmemory_ioctl_get_head(
u32 *elem_srptr = SHAREDREGION_INVALIDSRPTR;
int index;
cargs->api_status = LISTMPSHAREDMEMORY_E_FAIL;
elem = listmp_sharedmemory_get_head(cargs->args.get_head.listmp_handle);
if (unlikely(elem == NULL))
goto exit;
......@@ -337,6 +338,8 @@ static inline int listmp_sharedmemory_ioctl_get_tail(
u32 *elem_srptr = SHAREDREGION_INVALIDSRPTR;
int index;
cargs->api_status = LISTMPSHAREDMEMORY_E_FAIL;
elem = listmp_sharedmemory_get_tail(cargs->args.get_tail.listmp_handle);
if (unlikely(elem == NULL))
goto exit;
......@@ -363,6 +366,8 @@ static inline int listmp_sharedmemory_ioctl_put_head(
{
struct listmp_elem *elem;
cargs->api_status = LISTMPSHAREDMEMORY_E_FAIL;
elem = (struct listmp_elem *) sharedregion_get_ptr(
cargs->args.put_head.elem_srptr);
if (unlikely(elem == NULL))
......@@ -384,6 +389,8 @@ static inline int listmp_sharedmemory_ioctl_put_tail(
{
struct listmp_elem *elem;
cargs->api_status = LISTMPSHAREDMEMORY_E_FAIL;
elem = (struct listmp_elem *) sharedregion_get_ptr(
cargs->args.put_tail.elem_srptr);
if (unlikely(elem == NULL))
......
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