Skip to contentSkip to conversation

KEYS: asymmetric: Calculate size from pointer

PATCH New Riyan Dhiman 1 participant 1 message Sep 3, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KEYS: asymmetric: Calculate size from pointer

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.

---
 crypto/asymmetric_keys/asymmetric_type.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/asymmetric_keys/asymmetric_type.c +1 -1
index a5da8ccd353e..59b5c6f3ebb4 100644
@@ -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);
Signature · 1 line
2.46.0