diff mbox series

[4/6] Arm/GICv2: don't needlessly use xzalloc_bytes()

Message ID f08d9928-1285-4ca3-44e3-9e75d8cd9e5a@suse.com (mailing list archive)
State New, archived
Headers show
Series misc hardening and some cleanup | expand

Commit Message

Jan Beulich Feb. 5, 2020, 1:16 p.m. UTC
... when plain xzalloc() (which is more type safe) does.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Julien Grall Feb. 5, 2020, 2:29 p.m. UTC | #1
Hi Jan,

On 05/02/2020 13:16, Jan Beulich wrote:
> ... when plain xzalloc() (which is more type safe) does.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Julien Grall <julien@xen.org>

Cheers,

> 
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -969,7 +969,7 @@ static void gicv2_add_v2m_frame_to_list(
>                 nr_spis, V2M_MAX_SPI - V2M_MIN_SPI + 1);
>   
>       /* Allocate an entry to record new v2m frame information. */
> -    v2m_data = xzalloc_bytes(sizeof(struct v2m_data));
> +    v2m_data = xzalloc(struct v2m_data);
>       if ( !v2m_data )
>           panic("GICv2: Cannot allocate memory for v2m frame\n");
>   
>
diff mbox series

Patch

--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -969,7 +969,7 @@  static void gicv2_add_v2m_frame_to_list(
               nr_spis, V2M_MAX_SPI - V2M_MIN_SPI + 1);
 
     /* Allocate an entry to record new v2m frame information. */
-    v2m_data = xzalloc_bytes(sizeof(struct v2m_data));
+    v2m_data = xzalloc(struct v2m_data);
     if ( !v2m_data )
         panic("GICv2: Cannot allocate memory for v2m frame\n");