All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pv-grub: correct sizeof usage
@ 2014-03-29  5:08 Matthew Daley
  2014-03-30  7:29 ` Samuel Thibault
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Daley @ 2014-03-29  5:08 UTC (permalink / raw)
  To: xen-devel; +Cc: Samuel Thibault, Matthew Daley, xen-devel, Stefano Stabellini

We were lucky that sizeof(frame) >= sizeof(*frame) anyway.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
 stubdom/grub/mini-os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stubdom/grub/mini-os.c b/stubdom/grub/mini-os.c
index 64ab962..9d4bcc7 100644
--- a/stubdom/grub/mini-os.c
+++ b/stubdom/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);
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pv-grub: correct sizeof usage
  2014-03-29  5:08 [PATCH] pv-grub: correct sizeof usage Matthew Daley
@ 2014-03-30  7:29 ` Samuel Thibault
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2014-03-30  7:29 UTC (permalink / raw)
  To: Matthew Daley; +Cc: xen-devel, xen-devel, Stefano Stabellini

Matthew Daley, le Sat 29 Mar 2014 18:08:08 +1300, a écrit :
> We were lucky that sizeof(frame) >= sizeof(*frame) anyway.

Ouch, indeed!

> Signed-off-by: Matthew Daley <mattd@bugfuzz.com>

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  stubdom/grub/mini-os.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/stubdom/grub/mini-os.c b/stubdom/grub/mini-os.c
> index 64ab962..9d4bcc7 100644
> --- a/stubdom/grub/mini-os.c
> +++ b/stubdom/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);
> -- 
> 1.9.0
> 

-- 
Samuel
<D> N: j'aime bien Cut d'un truc enorme... ca montre de quel cote de l'ecran sont les couilles :)))
 -+- #ens-mim et la peufeupeu -+-

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-30  7:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-29  5:08 [PATCH] pv-grub: correct sizeof usage Matthew Daley
2014-03-30  7:29 ` Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.