[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/net: move allocation to the heap due to very large stack
From: |
Greg Kurz |
Subject: |
Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame |
Date: |
Fri, 9 Oct 2020 16:48:51 +0200 |
On Fri, 09 Oct 2020 07:02:56 -0700
Elena Afanasova <eafanasova@gmail.com> wrote:
> 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
>
Something seems to have gone wrong with the message body here, which
results in an awkward changelog... but maybe someone can fix that when
applying the patch.
> Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
> 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]),
- [PATCH] hw/net: move allocation to the heap due to very large stack frame, Elena Afanasova, 2020/10/09
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, Richard Henderson, 2020/10/09
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, Philippe Mathieu-Daudé, 2020/10/09
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame,
Greg Kurz <=
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, Li Qiang, 2020/10/09
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, David Gibson, 2020/10/10
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, Elena Afanasova, 2020/10/10
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, David Gibson, 2020/10/12
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, Thomas Huth, 2020/10/12
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, Paolo Bonzini, 2020/10/12
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, David Gibson, 2020/10/13
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, Elena Afanasova, 2020/10/14
- Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, David Gibson, 2020/10/15
Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame, Li Qiang, 2020/10/10