From b17ae8f98a0e0a67cb4c19158f76bdd95a0f5dcc Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Sat, 29 Mar 2014 18:08:08 +1300 Subject: [PATCH] pv-grub: correct sizeof usage We were lucky that sizeof(frame) >= sizeof(*frame) anyway. Signed-off-by: Matthew Daley Signed-off-by: Samuel Thibault Acked-by: Ian Campbell --- grub/mini-os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub/mini-os.c b/grub/mini-os.c index 64ab962..9d4bcc7 100644 --- a/grub/mini-os.c +++ b/grub/mini-os.c @@ -333,7 +333,7 @@ struct frame { static void minios_transmit (struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p) { - struct frame *frame = alloca(sizeof(frame) + s); + struct frame *frame = alloca(sizeof(*frame) + s); memcpy(frame->dest, d, ETH_ALEN); memcpy(frame->src, nic->node_addr, ETH_ALEN); -- 2.39.5