Thread (19 messages) 19 messages, 4 authors, 2017-10-04
STALE3217d

[PATCH] crypto: ccp: fix eno.cocci warnings

From: kbuild test robot <hidden>
Date: 2017-09-22 21:36:42
Also in: kvm, lkml

drivers/crypto/ccp/psp-dev.c:311:5-11: ERROR: allocation function on line 310 returns NULL not ERR_PTR on failure

 The various basic memory allocation functions don't return ERR_PTR

Generated by: scripts/coccinelle/null/eno.cocci

Fixes: 7d4ce155f344 ("crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support")
CC: Brijesh Singh <redacted>
Signed-off-by: Fengguang Wu <redacted>
---

 psp-dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/crypto/ccp/psp-dev.c
+++ b/drivers/crypto/ccp/psp-dev.c
@@ -308,7 +308,7 @@ static void *copy_user_blob(u64 __user u
 		return ERR_PTR(-EINVAL);
 
 	data = kmalloc(len, GFP_KERNEL);
-	if (IS_ERR(data))
+	if (!data)
 		return ERR_PTR(-ENOMEM);
 
 	if (copy_from_user(data, (void __user *)(uintptr_t)uaddr, len))
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help