Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1737867

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

From kbuild test robot <lkp@intel.com>
Newsgroups linux.kernel
Subject [PATCH] crypto: ccp: fix eno.cocci warnings
Date 2017-09-22 23:40 +0200
Message-ID <usDPX-2NY-13@gated-at.bofh.it> (permalink)
References <usDPX-2NY-9@gated-at.bofh.it> <usDPX-2NY-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <brijesh.singh@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 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))

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [Part2 PATCH v4 07/29] crypto: ccp: Add Secure Encrypted  Virtualization (SEV) command support kbuild test robot <lkp@intel.com> - 2017-09-22 23:40 +0200
  [PATCH] crypto: ccp: fix eno.cocci warnings kbuild test robot <lkp@intel.com> - 2017-09-22 23:40 +0200

csiph-web