summaryrefslogtreecommitdiffstats
path: root/drivers/misc/vmw_vmci
diff options
context:
space:
mode:
authorJunlin Yang <yangjunlin@yulong.com>2021-06-19 13:28:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-24 15:47:13 +0200
commit7487257cea875a2ee0aab088ee1dd92cd77698d4 (patch)
tree9c23cc451d528e772d99fb39050e51f5c331e422 /drivers/misc/vmw_vmci
parentsiox: Simplify error handling via dev_err_probe() (diff)
downloadlinux-7487257cea875a2ee0aab088ee1dd92cd77698d4.tar.xz
linux-7487257cea875a2ee0aab088ee1dd92cd77698d4.zip
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>
Diffstat (limited to 'drivers/misc/vmw_vmci')
-rw-r--r--drivers/misc/vmw_vmci/vmci_context.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_context.c b/drivers/misc/vmw_vmci/vmci_context.c
index 26ff49fdf0f7..c0b5e339d5a1 100644
--- a/drivers/misc/vmw_vmci/vmci_context.c
+++ b/drivers/misc/vmw_vmci/vmci_context.c
@@ -107,7 +107,7 @@ struct vmci_ctx *vmci_ctx_create(u32 cid, u32 priv_flags,
context = kzalloc(sizeof(*context), GFP_KERNEL);
if (!context) {
pr_warn("Failed to allocate memory for VMCI context\n");
- error = -EINVAL;
+ error = -ENOMEM;
goto err_out;
}