Commit 9ab53516 authored by Hari Kanigeri's avatar Hari Kanigeri

SYSLINK:ipc-fixes for sharedregion_get_table_info

This patch fixes the bugs in sharedregion_get_table_info
implementation. Fixed the BUG_ON call to check for
valid pointer and changed the check from (proc_count+1)
to proc_count in sharedregion_ioctl.c
Signed-off-by: default avatarHari Kanigeri <h-kanigeri2@ti.com>
Signed-off-by: default avatarArun Gopalakrishnan <arunmg@ti.com>
parent da3a17b9
...@@ -494,7 +494,7 @@ int sharedregion_get_table_info(u32 index, u16 proc_id, ...@@ -494,7 +494,7 @@ int sharedregion_get_table_info(u32 index, u16 proc_id,
u16 proc_count; u16 proc_count;
s32 retval = 0; s32 retval = 0;
BUG_ON(info != NULL); BUG_ON(info == NULL);
if (atomic_cmpmask_and_lt(&(sharedregion_state.ref_count), if (atomic_cmpmask_and_lt(&(sharedregion_state.ref_count),
SHAREDREGION_MAKE_MAGICSTAMP(0), SHAREDREGION_MAKE_MAGICSTAMP(0),
SHAREDREGION_MAKE_MAGICSTAMP(1)) == true) { SHAREDREGION_MAKE_MAGICSTAMP(1)) == true) {
......
...@@ -96,7 +96,7 @@ static int sharedregion_ioctl_setup(struct sharedregion_cmd_args *cargs) ...@@ -96,7 +96,7 @@ static int sharedregion_ioctl_setup(struct sharedregion_cmd_args *cargs)
proc_count = multiproc_get_max_processors(); proc_count = multiproc_get_max_processors();
table = cargs->args.setup.table; table = cargs->args.setup.table;
for (i = 0; i < config.max_regions; i++) { for (i = 0; i < config.max_regions; i++) {
for (j = 0; j < (proc_count + 1); j++) { for (j = 0; j < (proc_count); j++) {
sharedregion_get_table_info(i, j, &info); sharedregion_get_table_info(i, j, &info);
if (info.is_valid == true) { if (info.is_valid == true) {
/* Convert kernel virtual address to physical /* Convert kernel virtual address to physical
......
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