lib: cmsis_rtos_v2: kernel: Fix a coverity issue

Fixes an issue corresponding to CID: 190641

Fixes #12292.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
This commit is contained in:
Rajavardhan Gundi 2019-02-18 11:36:41 +05:30 committed by Anas Nashif
parent 40436f730b
commit 60186eba8c

View file

@ -17,12 +17,14 @@ extern u32_t z_tick_get_32(void);
*/
osStatus_t osKernelGetInfo(osVersion_t *version, char *id_buf, uint32_t id_size)
{
u32_t ver = sys_kernel_version_get();
if (version != NULL) {
version->api = sys_kernel_version_get();
version->kernel = sys_kernel_version_get();
version->api = ver;
version->kernel = ver;
}
if (id_buf != NULL) {
if ((id_buf != NULL) && (version != NULL)) {
snprintf(id_buf, id_size, "Zephyr V%2d.%2d.%2d",
SYS_KERNEL_VER_MAJOR(version->kernel),
SYS_KERNEL_VER_MINOR(version->kernel),