new_mcos_handler_info: Propagate kmalloc failure
Change-Id: If484cf32cd0bf096ffd712561dd1f73046c60cd8 Fujitsu: POSTK_TEMP_FIX_64
This commit is contained in:
committed by
Dominique Martinet
parent
39b21e7ba9
commit
e52d748744
@@ -330,11 +330,9 @@ struct mcos_handler_info *new_mcos_handler_info(ihk_os_t os, struct file *file)
|
|||||||
struct mcos_handler_info *info;
|
struct mcos_handler_info *info;
|
||||||
|
|
||||||
info = kmalloc(sizeof(struct mcos_handler_info), GFP_KERNEL);
|
info = kmalloc(sizeof(struct mcos_handler_info), GFP_KERNEL);
|
||||||
#ifdef POSTK_DEBUG_TEMP_FIX_64 /* host process is SIGKILLed fix. */
|
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif /* POSTK_DEBUG_TEMP_FIX_64 */
|
|
||||||
memset(info, '\0', sizeof(struct mcos_handler_info));
|
memset(info, '\0', sizeof(struct mcos_handler_info));
|
||||||
info->ud = ihk_host_os_get_usrdata(os);
|
info->ud = ihk_host_os_get_usrdata(os);
|
||||||
info->file = file;
|
info->file = file;
|
||||||
@@ -402,11 +400,9 @@ static long mcexec_newprocess(ihk_os_t os,
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
info = new_mcos_handler_info(os, file);
|
info = new_mcos_handler_info(os, file);
|
||||||
#ifdef POSTK_DEBUG_TEMP_FIX_64 /* host process is SIGKILLed fix. */
|
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
#endif /* POSTK_DEBUG_TEMP_FIX_64 */
|
|
||||||
info->pid = desc.pid;
|
info->pid = desc.pid;
|
||||||
ihk_os_register_release_handler(file, release_handler, info);
|
ihk_os_register_release_handler(file, release_handler, info);
|
||||||
ihk_os_set_mcos_private_data(file, info);
|
ihk_os_set_mcos_private_data(file, info);
|
||||||
@@ -438,12 +434,10 @@ static long mcexec_start_image(ihk_os_t os,
|
|||||||
}
|
}
|
||||||
|
|
||||||
info = new_mcos_handler_info(os, file);
|
info = new_mcos_handler_info(os, file);
|
||||||
#ifdef POSTK_DEBUG_TEMP_FIX_64 /* host process is SIGKILLed fix. */
|
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
#endif /* POSTK_DEBUG_TEMP_FIX_64 */
|
|
||||||
|
|
||||||
info->pid = desc->pid;
|
info->pid = desc->pid;
|
||||||
info->cpu = desc->cpu;
|
info->cpu = desc->cpu;
|
||||||
|
|||||||
Reference in New Issue
Block a user