[PATCH] crypto,fs: fix noderef.cocci warnings

kernel test robot posted 1 patch 4 years, 3 months ago
crypto/hkdf.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] crypto,fs: fix noderef.cocci warnings
Posted by kernel test robot 4 years, 3 months ago
From: kernel test robot <lkp@intel.com>

crypto/hkdf.c:94:25-31: ERROR: application of sizeof to pointer

 sizeof when applied to a pointer typed expression gives the size of
 the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

Fixes: ea4c6fc32e5e ("crypto,fs: Separate out hkdf_extract() and hkdf_expand()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git tls-upcall.v4
head:   d2416ecdb6b03fc2e4aa40b20cdf919322713224
commit: ea4c6fc32e5e02a1e4c841f462c3a931b8838f33 [118/156] crypto,fs: Separate out hkdf_extract() and hkdf_expand()
:::::: branch date: 3 days ago
:::::: commit date: 5 days ago

 crypto/hkdf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/crypto/hkdf.c
+++ b/crypto/hkdf.c
@@ -91,7 +91,7 @@ int hkdf_expand(struct crypto_shash *hma
 			if (err)
 				goto out;
 			memcpy(&okm[i], tmp, okmlen - i);
-			memzero_explicit(tmp, sizeof(tmp));
+			memzero_explicit(tmp, sizeof(*tmp));
 		} else {
 			err = crypto_shash_finup(desc, &counter, 1, &okm[i]);
 			if (err)