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

SYSLINK: ipc - minor fixes in sharedregion and gatepeterson driver

This patch provides fixes for minor bugs in gatepeterson driver
and sharedregion modules. gatepeterson driver has an incorrect
parameter check. Error traces are slightly adjusted in the
sharedregion module. Double semi-colons are corrected.
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
parent 23335aa8
...@@ -392,7 +392,7 @@ obj_alloc_fail: ...@@ -392,7 +392,7 @@ obj_alloc_fail:
handle_alloc_fail: /* Fall through */ handle_alloc_fail: /* Fall through */
exit: exit:
printk(KERN_ERR "gatepeterson_create failed status: %x\n", retval); printk(KERN_ERR "gatepeterson_create failed status: %x\n", retval);
return NULL;; return NULL;
} }
EXPORT_SYMBOL(gatepeterson_create); EXPORT_SYMBOL(gatepeterson_create);
...@@ -845,7 +845,7 @@ void gatepeterson_leave(void *gphandle, u32 flag) ...@@ -845,7 +845,7 @@ void gatepeterson_leave(void *gphandle, u32 flag)
BUG_ON(gatepeterson_state.is_init != true); BUG_ON(gatepeterson_state.is_init != true);
BUG_ON(gphandle == NULL); BUG_ON(gphandle == NULL);
handle = (struct gatepeterson_object *)gphandle;; handle = (struct gatepeterson_object *)gphandle;
(void) flag; (void) flag;
obj = (struct gatepeterson_obj *)handle->obj; obj = (struct gatepeterson_obj *)handle->obj;
obj->nested--; obj->nested--;
......
...@@ -190,7 +190,7 @@ static int gatepeterson_ioctl_open(struct gatepeterson_cmd_args *cargs) ...@@ -190,7 +190,7 @@ static int gatepeterson_ioctl_open(struct gatepeterson_cmd_args *cargs)
if (cargs->args.open.name_len > 0) { if (cargs->args.open.name_len > 0) {
params.name = kmalloc(cargs->args.open.name_len + 1, params.name = kmalloc(cargs->args.open.name_len + 1,
GFP_KERNEL); GFP_KERNEL);
if (params.name != NULL) { if (params.name == NULL) {
status = -ENOMEM; status = -ENOMEM;
goto exit; goto exit;
} }
......
...@@ -324,8 +324,10 @@ int sharedregion_get_index(void *addr) ...@@ -324,8 +324,10 @@ int sharedregion_get_index(void *addr)
myproc_id = multiproc_get_id(NULL); myproc_id = multiproc_get_id(NULL);
retval = mutex_lock_interruptible(sharedregion_state.gate_handle); retval = mutex_lock_interruptible(sharedregion_state.gate_handle);
if (retval) if (retval) {
retval = -ENODEV;
goto exit; goto exit;
}
table = sharedregion_state.table; table = sharedregion_state.table;
for (i = 0; i < sharedregion_state.cfg.max_regions; i++) { for (i = 0; i < sharedregion_state.cfg.max_regions; i++) {
...@@ -345,9 +347,10 @@ int sharedregion_get_index(void *addr) ...@@ -345,9 +347,10 @@ int sharedregion_get_index(void *addr)
retval = -ENOENT; /* No entry found in the table */ retval = -ENOENT; /* No entry found in the table */
mutex_unlock(sharedregion_state.gate_handle); mutex_unlock(sharedregion_state.gate_handle);
return retval;
exit: exit:
printk(KERN_ERR "sharedregion_get_index failed status:%x\n", retval); printk(KERN_ERR "sharedregion_get_index failed index:%x\n", retval);
return retval; return retval;
} }
EXPORT_SYMBOL(sharedregion_get_index); EXPORT_SYMBOL(sharedregion_get_index);
......
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