Re: [PATCH v2 14/20] s390/zcrypt: Locate ep11_domain_query_info onto the stack instead of kmalloc

Holger Dengler
2025-03-20T14:41:45Z

On 04/03/2025 18:21, Harald Freudenberger wrote:
> Locate the relative small struct ep11_domain_query_info variable
> onto the stack instead of kmalloc()/kfree().
>
> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>

One minor comment.
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>

> ---
> drivers/s390/crypto/zcrypt_ep11misc.c | 25 ++++++++++---------------
> 1 file changed, 10 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/s390/crypto/zcrypt_ep11misc.c b/drivers/s390/crypto/zcrypt_ep11misc.c
> index 6005ef79c001..7fb55be3e943 100644
> --- a/drivers/s390/crypto/zcrypt_ep11misc.c
> +++ b/drivers/s390/crypto/zcrypt_ep11misc.c
> @@ -790,36 +790,31 @@ int ep11_get_domain_info(u16 card, u16 domain, struct ep11_domain_info *info)
> u8 new_WK_VP[32];
> u32 dom_flags;
> u64 op_mode;
> - } __packed * p_dom_info;
> -
> - p_dom_info = kmalloc(sizeof(*p_dom_info), GFP_KERNEL);
> - if (!p_dom_info)
> - return -ENOMEM;
> + } __packed dom_query_info;

Why is dom_query_info a typed struct? The struct type is not used and an untyped struct can be used as well.

--
Mit freundlichen Grüßen / Kind regards
Holger Dengler
--
IBM Systems, Linux on IBM Z Development
dengler@linux.ibm.com