summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorFedor Pchelkin <pchelkin@ispras.ru>2024-05-04 13:47:02 +0200
committerChristoph Hellwig <hch@lst.de>2024-05-23 15:06:47 +0200
commitf7c9ccaadffd13066353332c13d7e9bf73b8f92d (patch)
tree90120e56ef675342f2a2081b99e2ece9897331c9 /kernel
parentdma-mapping: benchmark: fix up kthread-related error handling (diff)
downloadlinux-f7c9ccaadffd13066353332c13d7e9bf73b8f92d.tar.xz
linux-f7c9ccaadffd13066353332c13d7e9bf73b8f92d.zip
dma-mapping: benchmark: avoid needless copy_to_user if benchmark fails
If do_map_benchmark() has failed, there is nothing useful to copy back to userspace. Suggested-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Acked-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/dma/map_benchmark.c3
1 files changed, 3 insertions, 0 deletions
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;