Skip to contentSkip to conversation

misc: vmw_vmci: return the correct errno code

PATCH New angkery 1 participant 1 message Jun 19, 2021

Subsystems (2)
lore
Share & tools
lore

angkery

author
#0 lore raw

PATCH 1/1 misc: vmw_vmci: return the correct errno code

From: Junlin Yang <[email protected]>

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

---
 drivers/misc/vmw_vmci/vmci_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/vmw_vmci/vmci_context.c +1 -1
index 26ff49f..c0b5e33 100644
@@ -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;
 	}
 
Signature · 1 line
1.9.1