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>
This commit is contained in:
Fedor Pchelkin 2024-05-04 14:47:02 +03:00 committed by Christoph Hellwig
parent bb9025f443
commit f7c9ccaadf

View File

@ -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;