[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7dd13232-b5c0-42b1-b096-f374dd9bef85@arm.com>
Date: Fri, 10 May 2024 18:52:56 +0100
From: Robin Murphy <robin.murphy@....com>
To: Fedor Pchelkin <pchelkin@...ras.ru>,
Xiang Chen <chenxiang66@...ilicon.com>, Barry Song <21cnbao@...il.com>
Cc: Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, Alexey Khoroshilov <khoroshilov@...ras.ru>,
lvc-project@...uxtesting.org
Subject: Re: [PATCH v2 2/4] dma-mapping: benchmark: avoid needless
copy_to_user if benchmark fails
On 2024-05-04 12:47 pm, Fedor Pchelkin wrote:
> If do_map_benchmark() has failed, there is nothing useful to copy back
> to userspace.
I guess there could be some valid partial data if for instance it failed
due to OOM in the middle of running, but the standard tool is still
going to ignore that if the ioctl() returns an error, so meh.
Acked-by: Robin Murphy <robin.murphy@....com>
> Suggested-by: Barry Song <21cnbao@...il.com>
> Signed-off-by: Fedor Pchelkin <pchelkin@...ras.ru>
> ---
> kernel/dma/map_benchmark.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c
> index 2478957cf9f8..a6edb1ef98c8 100644
> --- a/kernel/dma/map_benchmark.c
> +++ b/kernel/dma/map_benchmark.c
> @@ -256,6 +256,9 @@ static long map_benchmark_ioctl(struct file *file, unsigned int cmd,
> * dma_mask changed by benchmark
> */
> dma_set_mask(map->dev, old_dma_mask);
> +
> + if (ret)
> + return ret;
> break;
> default:
> return -EINVAL;
Powered by blists - more mailing lists