[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4ebeac2-c180-0ca0-5170-e9ff2fac32e9@cambridgegreys.com>
Date: Thu, 28 Nov 2019 07:51:06 +0000
From: Anton Ivanov <anton.ivanov@...bridgegreys.com>
To: Wei Yongjun <weiyongjun1@...wei.com>,
Jeff Dike <jdike@...toit.com>,
Richard Weinberger <richard@....at>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>
Cc: kernel-janitors@...r.kernel.org, linux-um@...ts.infradead.org,
bpf@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH -next] um: vector: use GFP_ATOMIC under spin lock
On 28/11/2019 02:01, Wei Yongjun wrote:
> A spin lock is taken here so we should use GFP_ATOMIC.
>
> Fixes: 9807019a62dc ("um: Loadable BPF "Firmware" for vector drivers")
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
> ---
> arch/um/drivers/vector_kern.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
> index 92617e16829e..6ff0065a271d 100644
> --- a/arch/um/drivers/vector_kern.c
> +++ b/arch/um/drivers/vector_kern.c
> @@ -1402,7 +1402,7 @@ static int vector_net_load_bpf_flash(struct net_device *dev,
> kfree(vp->bpf->filter);
> vp->bpf->filter = NULL;
> } else {
> - vp->bpf = kmalloc(sizeof(struct sock_fprog), GFP_KERNEL);
> + vp->bpf = kmalloc(sizeof(struct sock_fprog), GFP_ATOMIC);
> if (vp->bpf == NULL) {
> netdev_err(dev, "failed to allocate memory for firmware\n");
> goto flash_fail;
> @@ -1414,7 +1414,7 @@ static int vector_net_load_bpf_flash(struct net_device *dev,
> if (request_firmware(&fw, efl->data, &vdevice->pdev.dev))
> goto flash_fail;
>
> - vp->bpf->filter = kmemdup(fw->data, fw->size, GFP_KERNEL);
> + vp->bpf->filter = kmemdup(fw->data, fw->size, GFP_ATOMIC);
> if (!vp->bpf->filter)
> goto free_buffer;
>
>
>
>
Acked-by: Anton Ivanov <anton.ivanov@...bridgegreys.co.uk>
> _______________________________________________
> linux-um mailing list
> linux-um@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-um
>
--
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/
Powered by blists - more mailing lists