mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KEYS: asymmetric: Calculate size from pointer
@ 2024-09-03 13:48 Riyan Dhiman
  0 siblings, 0 replies; only message in thread
From: Riyan Dhiman @ 2024-09-03 13:48 UTC (permalink / raw)
  To: dhowells; +Cc: keyrings, linux-crypto, linux-kernel, Riyan Dhiman

Calculate the size from pointer instead of
struct to adhere to linux kernel coding style.

Issue reported by checkpatch.

This commit has no functional changes.

Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
---
 crypto/asymmetric_keys/asymmetric_type.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c
index a5da8ccd353e..59b5c6f3ebb4 100644
--- a/crypto/asymmetric_keys/asymmetric_type.c
+++ b/crypto/asymmetric_keys/asymmetric_type.c
@@ -151,7 +151,7 @@ struct asymmetric_key_id *asymmetric_key_generate_id(const void *val_1,
 {
 	struct asymmetric_key_id *kid;
 
-	kid = kmalloc(sizeof(struct asymmetric_key_id) + len_1 + len_2,
+	kid = kmalloc(sizeof(*kid) + len_1 + len_2,
 		      GFP_KERNEL);
 	if (!kid)
 		return ERR_PTR(-ENOMEM);
-- 
2.46.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-03 13:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-03 13:48 [PATCH] KEYS: asymmetric: Calculate size from pointer Riyan Dhiman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®