[PATCH -next] firmware: imx: secure-enclave: use kzalloc_obj() for allocations

From: Pankaj Gupta

Date: Fri May 08 2026 - 02:07:30 EST


Replace kzalloc(sizeof(*ptr), ...) with kzalloc_obj() for object
allocations to follow current kernel allocation style and reduce
boilerplate.

No functional change intended.

This is a cleanup reported after initial merge and is intended to be
squashed into the original commit.

Fixes: 4de71839142b ("firmware: drivers: imx: adds miscdev")
Signed-off-by: Pankaj Gupta <pankaj.gupta@xxxxxxx>
---
drivers/firmware/imx/se_ctrl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/imx/se_ctrl.c b/drivers/firmware/imx/se_ctrl.c
index 814a1946d1c2..ef85a0336693 100644
--- a/drivers/firmware/imx/se_ctrl.c
+++ b/drivers/firmware/imx/se_ctrl.c
@@ -379,7 +379,7 @@ static int add_b_desc_to_pending_list(void *shared_ptr_with_pos,
struct se_shared_mem_mgmt_info *se_shared_mem_mgmt = &dev_ctx->se_shared_mem_mgmt;
struct se_buf_desc *b_desc;

- b_desc = kzalloc(sizeof(*b_desc), GFP_KERNEL);
+ b_desc = kzalloc_obj(*b_desc, GFP_KERNEL);
if (!b_desc)
return -ENOMEM;

@@ -464,7 +464,7 @@ static int init_device_context(struct se_if_priv *priv, int ch_id,
struct se_if_device_ctx *dev_ctx;
int ret = 0;

- dev_ctx = kzalloc(sizeof(*dev_ctx), GFP_KERNEL);
+ dev_ctx = kzalloc_obj(*dev_ctx, GFP_KERNEL);

if (!dev_ctx)
return -ENOMEM;
--
2.43.0