new_mcos_handler_info: Propagate kmalloc failure

Change-Id: If484cf32cd0bf096ffd712561dd1f73046c60cd8
Fujitsu: POSTK_TEMP_FIX_64
This commit is contained in:
Masamichi Takagi
2019-01-28 17:47:57 +09:00
committed by Dominique Martinet
parent 39b21e7ba9
commit e52d748744

View File

@ -330,11 +330,9 @@ struct mcos_handler_info *new_mcos_handler_info(ihk_os_t os, struct file *file)
struct mcos_handler_info *info;
info = kmalloc(sizeof(struct mcos_handler_info), GFP_KERNEL);
#ifdef POSTK_DEBUG_TEMP_FIX_64 /* host process is SIGKILLed fix. */
if (info == NULL) {
return NULL;
}
#endif /* POSTK_DEBUG_TEMP_FIX_64 */
memset(info, '\0', sizeof(struct mcos_handler_info));
info->ud = ihk_host_os_get_usrdata(os);
info->file = file;
@ -402,11 +400,9 @@ static long mcexec_newprocess(ihk_os_t os,
return -EFAULT;
}
info = new_mcos_handler_info(os, file);
#ifdef POSTK_DEBUG_TEMP_FIX_64 /* host process is SIGKILLed fix. */
if (info == NULL) {
return -ENOMEM;
}
#endif /* POSTK_DEBUG_TEMP_FIX_64 */
info->pid = desc.pid;
ihk_os_register_release_handler(file, release_handler, 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);
#ifdef POSTK_DEBUG_TEMP_FIX_64 /* host process is SIGKILLed fix. */
if (info == NULL) {
ret = -ENOMEM;
goto out;
}
#endif /* POSTK_DEBUG_TEMP_FIX_64 */
info->pid = desc->pid;
info->cpu = desc->cpu;