All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/net: move allocation to the heap due to very large stack frame
@ 2020-10-09 14:02 Elena Afanasova
  2020-10-09 14:14 ` Richard Henderson
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Elena Afanasova @ 2020-10-09 14:02 UTC (permalink / raw)
  To: david, jasowang, qemu-ppc, qemu-devel; +Cc: qemu-trivial

From 09905773a00e417d3a37c12350d9e55466fdce8a Mon Sep 17 00:00:00 2001
From: Elena Afanasova <eafanasova@gmail.com>
Date: Fri, 9 Oct 2020 06:41:36 -0700
Subject: [PATCH] hw/net: move allocation to the heap due to very large stack
 frame

Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
---
 hw/net/spapr_llan.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
index 2093f1bad0..581320a0e7 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -688,7 +688,8 @@ static target_ulong h_send_logical_lan(PowerPCCPU *cpu,
     SpaprVioDevice *sdev = spapr_vio_find_by_reg(spapr->vio_bus, reg);
     SpaprVioVlan *dev = VIO_SPAPR_VLAN_DEVICE(sdev);
     unsigned total_len;
-    uint8_t *lbuf, *p;
+    uint8_t *p;
+    g_autofree uint8_t *lbuf = NULL;
     int i, nbufs;
     int ret;
 
@@ -729,7 +730,7 @@ static target_ulong h_send_logical_lan(PowerPCCPU *cpu,
         return H_RESOURCE;
     }
 
-    lbuf = alloca(total_len);
+    lbuf = g_malloc(total_len);
     p = lbuf;
     for (i = 0; i < nbufs; i++) {
         ret = spapr_vio_dma_read(sdev, VLAN_BD_ADDR(bufs[i]),
-- 
2.25.1




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

end of thread, other threads:[~2020-10-16  0:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 14:02 [PATCH] hw/net: move allocation to the heap due to very large stack frame Elena Afanasova
2020-10-09 14:14 ` Richard Henderson
2020-10-09 14:25 ` Philippe Mathieu-Daudé
2020-10-09 14:48 ` Greg Kurz
2020-10-09 14:55 ` Li Qiang
2020-10-10  6:07 ` David Gibson
2020-10-10 15:53   ` Elena Afanasova
2020-10-12  5:30     ` David Gibson
2020-10-12 10:44       ` Thomas Huth
2020-10-12 13:45         ` Paolo Bonzini
2020-10-13  5:32           ` David Gibson
2020-10-14 14:15             ` Elena Afanasova
2020-10-16  0:32               ` David Gibson
2020-10-11  2:23   ` Li Qiang
2020-10-12  5:28     ` David Gibson
2020-10-12 11:09   ` Philippe Mathieu-Daudé
2020-10-12 11:48     ` Philippe Mathieu-Daudé

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.