In case of that the requested memory size is invalid,
the next statement might be caused SEGV problem because of index value.
In addition to this, some log messages are modified.
Change-Id: I22820b42c714e5a5d3416b6fa118841a46dca1d8
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
index = LARGE;
} else {
ERROR("invalid buffer size: %x\n", buf_size);
+ return -1;
}
block = &maru_brill_codec->memory_blocks[index];
index = LARGE;
} else {
// error
+ ERROR("invalid memory offsset. offset = 0x%x.\n", (uint32_t)mem_offset);
+ return;
}
block = &maru_brill_codec->memory_blocks[index];
}
found = true;
-
break;
}
}
if (!found) {
// can not enter here...
- ERROR("there is no used memory block. offset = 0x%x.\n", (uint32_t)mem_offset);
+ ERROR("cannot find this memory block. offset = 0x%x.\n", (uint32_t)mem_offset);
}
} else {
// can not enter here...
- ERROR("there is no used memory block.\n");
+ DEBUG("there is not any using memory block.\n");
}
-
mutex_unlock(&block->access_mutex);
}