Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: vmw_vmci: return the correct errno code

When kzalloc failed, should return -ENOMEM rather than -EINVAL.

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
Link: https://lore.kernel.org/r/20210619112854.1720-1-angkery@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Junlin Yang and committed by
Greg Kroah-Hartman
7487257c 75020f2d

+1 -1
+1 -1
drivers/misc/vmw_vmci/vmci_context.c
··· 107 107 context = kzalloc(sizeof(*context), GFP_KERNEL); 108 108 if (!context) { 109 109 pr_warn("Failed to allocate memory for VMCI context\n"); 110 - error = -EINVAL; 110 + error = -ENOMEM; 111 111 goto err_out; 112 112 } 113 113